Commit b526f9ae authored by Stratos Psomadakis's avatar Stratos Psomadakis Committed by root
Browse files

Catch IPy exceptions for invalid networks/subnets

Signed-off-by: default avatarStratos Psomadakis <>
parent d9361b6e
......@@ -195,9 +195,13 @@ def parse_binding_file(path):
elif line.startswith("EUI64="):
eui64 = get_value(line)
return Client(tap=tap, mac=mac, ip=ip,
client = Client(tap=tap, mac=mac, ip=ip,
hostname=hostname, indev=indev, subnet=subnet,
gateway=gateway, subnet6=subnet6, gateway6=gateway6, eui64=eui64 )
return client
return None
class ClientFileHandler(pyinotify.ProcessEvent):
def __init__(self, server):
......@@ -245,7 +249,10 @@ class Client(object):
class Subnet(object):
def __init__(self, net=None, gw=None, dev=None):
if isinstance(net, str): = IPy.IP(net)
try: = IPy.IP(net)
raise Exception
else: = net = gw
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