]> git.llucax.com Git - software/pymin.git/commitdiff
Rearrange Host attributes from vpn service (closes #33)
authorLeandro Lucarella <llucax@gmail.com>
Sat, 28 Jun 2008 04:43:33 +0000 (01:43 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Sat, 28 Jun 2008 04:52:49 +0000 (01:52 -0300)
The attribute names are named after the tinc configuration variables to
avoid confusion and the name of the host is now the HostHandler key.

services/vpn/host.py
services/vpn/templates/host

index d22de661715644a8f4de92cc459a991c1fe84b9b..37afc7413c9bf747dcef989041f53e5aef84d724 100644 (file)
@@ -7,15 +7,15 @@ __all__ = ('HostHandler',)
 
 
 class Host(Sequence):
-    def __init__(self, vpn_src, ip, vpn_src_net, key):
-        self.name = vpn_src
-        self.ip = ip
-        self.src_net = vpn_src_net
-        self.pub_key = key
+    def __init__(self, name, address, subnet, public_key):
+        self.name = name
+        self.address = address
+        self.subnet = subnet
+        self.public_key = public_key
         self._delete = False
 
     def as_tuple(self):
-        return(self.name, self.ip, self.src_net, self.pub_key)
+        return(self.name, self.address, self.subnet, self.public_key)
 
 class HostHandler(DictComposedSubHandler):
 
index c2a2acbc9e39d3f503f39c96e72398fa68f8a864..8ff79176b9dd3e77bad54dbc29a987c2c1dc99d3 100644 (file)
@@ -1,3 +1,4 @@
-Address = ${host.ip}
-Subnet = ${host.src_net}
-${host.pub_key}
+# Host ${host.name} configuration
+Address = ${host.address}
+Subnet = ${host.subnet}
+${host.public_key}