From 2cf88eef7062049b525537c45c0884a985143de9 Mon Sep 17 00:00:00 2001 From: Julien Muchembled Date: Fri, 11 Jul 2014 15:43:33 +0200 Subject: [PATCH] Code cleanup --- re6st/plib.py | 3 +-- re6st/registry.py | 1 - re6st/utils.py | 5 +++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/re6st/plib.py b/re6st/plib.py index d8b8859..2715242 100644 --- a/re6st/plib.py +++ b/re6st/plib.py @@ -42,8 +42,7 @@ def server(iface, max_clients, dh_path, pipe_fd, port, proto, encrypt, *args, ** def client(iface, address_list, encrypt, *args, **kw): remote = ['--nobind', '--client'] for ip, port, proto in address_list: - remote += '--remote', ip, port, \ - proto + '-client' if proto in ('tcp', 'tcp6') else proto + remote += '--remote', ip, port, proto remote += args return openvpn(iface, encrypt, *remote, **kw) diff --git a/re6st/registry.py b/re6st/registry.py index 7843a7d..f35c66c 100644 --- a/re6st/registry.py +++ b/re6st/registry.py @@ -281,7 +281,6 @@ class RegistryServer(object): peers = deque(('%u/%u' % (int(self.prefix, 2), len(self.prefix)),)) cookie = hex(random.randint(0, 1<<32))[2:] graph = dict.fromkeys(peers) - asked = 0 while True: r, w, _ = select.select([self.sock], [self.sock] if peers else [], [], 1) diff --git a/re6st/utils.py b/re6st/utils.py index a75205e..4cd19ca 100644 --- a/re6st/utils.py +++ b/re6st/utils.py @@ -200,8 +200,9 @@ def dump_address(address): def parse_address(address_list): for address in address_list.split(';'): try: - ip, port, proto = address.split(',') - yield ip, str(port), proto + a = ip, port, proto = address.split(',') + int(port) + yield a except ValueError, e: logging.warning("Failed to parse node address %r (%s)", address, e) -- 2.25.1