Commit 2cf88eef authored by Julien Muchembled's avatar Julien Muchembled

Code cleanup

parent 6d759c9b
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment