From 92e78eed502eb39da30a133ab473d80fca425646 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 28 Jun 2008 01:43:33 -0300 Subject: [PATCH] Rearrange Host attributes from vpn service (closes #33) 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 | 12 ++++++------ services/vpn/templates/host | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/services/vpn/host.py b/services/vpn/host.py index d22de66..37afc74 100644 --- a/services/vpn/host.py +++ b/services/vpn/host.py @@ -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): diff --git a/services/vpn/templates/host b/services/vpn/templates/host index c2a2acb..8ff7917 100644 --- a/services/vpn/templates/host +++ b/services/vpn/templates/host @@ -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} -- 2.43.0