pvl/hosts/host.py
changeset 446 139b3a41b608
parent 441 f058fff1f272
child 450 1d86e3909678
--- 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)