pvl/hosts.py
changeset 385 01d31fda75ab
parent 383 87b49aa52b3d
child 412 b557b472ffa1
--- a/pvl/hosts.py	Mon Mar 17 17:31:45 2014 +0200
+++ b/pvl/hosts.py	Mon Mar 17 17:36:59 2014 +0200
@@ -99,8 +99,11 @@
     
     @classmethod
     def build (cls, options, host, domain,
-            ip=None, ip6=None, owner=None, boot=None, alias=None, alias4=None, alias6=None, forward=None, reverse=None,
+            ip=None, ip6=None, owner=None, location=None,
+            alias=None, alias4=None, alias6=None,
+            forward=None, reverse=None,
             down=None,
+            boot=None,
             **extra) :
         """
             Return a Host from a config section's scalars.
@@ -173,6 +176,9 @@
         else :
             down = None
         
+        if not location :
+            location = None
+
         return cls(host,
                 domain      = domain,
                 ip          = ipaddr.IPv4Address(ip) if ip else None,
@@ -182,6 +188,7 @@
                 alias4      = alias4,
                 alias6      = alias6,
                 owner       = owner,
+                location    = location,
                 boot        = boot,
                 forward     = forward,
                 reverse     = reverse,
@@ -196,6 +203,7 @@
             ethernet={ },
             alias=(),
             owner=None,
+            location=None,
             boot=None,
             alias4=None, alias6=None,
             forward=None, reverse=None,
@@ -210,6 +218,7 @@
             ethernet    - { index: ethernet }
             alias       - list
             owner       - str: LDAP uid
+            location    - name
             alias4      - list (CNAME -> A)
             alias6      - list (CNAME -> AAAA)
             forward     - generate forward records, or CNAME into given zone
@@ -226,6 +235,7 @@
         self.alias4 = alias4
         self.alias6 = alias6
         self.owner = owner
+        self.location = location
         self.boot = boot
         self.forward = forward
         self.reverse = reverse