pvl.hosts: ip6, boot support
authorTero Marttila <terom@paivola.fi>
Mon, 16 Dec 2013 20:49:50 +0200
changeset 282 63135113fe01
parent 281 b236f689ba22
child 283 951e4b70bad4
pvl.hosts: ip6, boot support
pvl/hosts.py
--- a/pvl/hosts.py	Mon Dec 16 20:49:14 2013 +0200
+++ b/pvl/hosts.py	Mon Dec 16 20:49:50 2013 +0200
@@ -50,7 +50,7 @@
             yield cls.build(options, host, ip=ip, **extra)
     
     @classmethod
-    def build (cls, options, host, domain=None, ip=None, owner=None, **extra) :
+    def build (cls, options, host, domain=None, ip=None, ip6=None, owner=None, boot=None, **extra) :
         """
             Return a Host from a config section's scalars.
         """
@@ -71,17 +71,20 @@
         
         return cls(host,
                 domain      = domain,
-                ip          = ipaddr.IPAddress(ip) if ip else None,
+                ip          = ipaddr.IPv4Address(ip) if ip else None,
+                ip6         = ipaddr.IPv6Address(ip6) if ip6 else None,
                 ethernet    = ethernet,
                 alias       = alias,
                 owner       = owner,
+                boot        = boot,
         )
 
-    def __init__ (self, host, domain=None, ip=None, ethernet=(), alias=(), owner=None) :
+    def __init__ (self, host, domain=None, ip=None, ip6=None, ethernet=(), alias=(), owner=None, boot=None) :
         """
             host        - str
             domain      - str
-            ip          - ipaddr.IPAddress
+            ip          - ipaddr.IPv4Address
+            ip6         - ipaddr.IPv6Address
             ethernet    - list
             alias       - list
             owner       - str: LDAP uid
@@ -89,9 +92,11 @@
         self.host = host
         self.domain = domain
         self.ip = ip
+        self.ip6 = ip6
         self.ethernet = ethernet
         self.alias = alias
         self.owner = owner
+        self.boot = boot
 
     def __str__ (self) :
         return str(self.host)