From bc12a6ad848bf1de06d8b831d4b67f7d552dd43f Mon Sep 17 00:00:00 2001 From: brent s Date: Mon, 18 May 2020 05:41:00 -0400 Subject: [PATCH] hrm --- utils/he_ipv6/ra.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/utils/he_ipv6/ra.py b/utils/he_ipv6/ra.py index b139d0e..2b5591e 100644 --- a/utils/he_ipv6/ra.py +++ b/utils/he_ipv6/ra.py @@ -16,23 +16,16 @@ class RA(object): class RAConf(object): - def_tpl_name = None - def_conf = None cfgstr = None - def_tpl_dir = os.path.join(os.path.dirname(os.path.abspath(os.path.expanduser(__file__))), 'tpl') + tpl_dir = os.path.join(os.path.dirname(os.path.abspath(os.path.expanduser(__file__))), 'tpl') def __init__(self, conf = None, tpl_name = None, tpl_dir = None, *args, **kwargs): for k in ('name', 'dir'): n = 'tpl_{0}'.format(k) - d = 'def_tpl_{0}'.format(k) v = locals()[n] - if not v: - setattr(self, n, getattr(self, d)) - else: + if v: setattr(self, n, v) - if not conf: - self.conf = self.def_conf - else: + if conf: self.conf = os.path.abspath(os.path.expanduser(conf)) def ext_init(self): @@ -140,8 +133,8 @@ class RASvc(object): class RADVD(RA): name = 'radvd' - def_conf = '/etc/radvd.conf' - def_tpl_name = 'radvd.conf.j2' + conf = '/etc/radvd.conf' + tpl_name = 'radvd.conf.j2' def __init__(self, conf = None, tpl_name = None, tpl_dir = None): super().__init__(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir) @@ -150,8 +143,8 @@ class RADVD(RA): class DNSMasq(RA): name = 'dnsmasq' - def_conf = '/etc/dnsmasq.d/ra.conf' - def_tpl_name = 'dnsmasq.include.j2' + conf = '/etc/dnsmasq.d/ra.conf' + tpl_name = 'dnsmasq.include.j2' def __init__(self, conf = None, tpl_name = None, tpl_dir = None): super().__init__(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir)