--- a/pvl/hosts/host.py Tue Feb 24 17:48:42 2015 +0200
+++ b/pvl/hosts/host.py Tue Feb 24 18:06:32 2015 +0200
@@ -133,8 +133,7 @@
**extensions
)
- def __init__ (self, host,
- domain=None,
+ def __init__ (self, name, domain,
ip=None, ip6=None,
ethernet={ },
alias=(),
@@ -148,7 +147,7 @@
**extensions
) :
"""
- host - str
+ name - str
domain - str
ip - ipaddr.IPv4Address
ip6 - ipaddr.IPv6Address
@@ -164,7 +163,7 @@
down - not online
"""
- self.host = host
+ self.name = name
self.domain = domain
self.ip = ip
self.ip6 = ip6
@@ -194,12 +193,12 @@
return ipaddr.IPAddress(0)
def fqdn (self) :
- if '.' in self.host :
- return self.host + '.'
+ if '.' in self.name:
+ return self.name + '.'
elif self.domain :
- return pvl.dns.zone.fqdn(self.host, self.domain)
+ return pvl.dns.zone.fqdn(self.name, self.domain)
else :
raise ValueError("%s: have no fqdn/domain" % (self, ))
def __str__ (self) :
- return str(self.host)
+ return "{self.name}@{self.domain}".format(self=self)