Commit fd87fef6 authored by martin's avatar martin

Compat with braindead ubuntu changes

parent a059a46d
...@@ -292,7 +292,7 @@ def get_if_data(): ...@@ -292,7 +292,7 @@ def get_if_data():
match = re.search(r'^(\d+):\s+(.*)', line) match = re.search(r'^(\d+):\s+(.*)', line)
idx = int(match.group(1)) idx = int(match.group(1))
match = re.search(r'^(\d+): (\S+): <(\S+)> mtu (\d+) qdisc \S+' + match = re.search(r'^(\d+): (\S+): <(\S+)> mtu (\d+) qdisc \S+' +
r'.*link/\S+ ([0-9a-f:]+) brd ([0-9a-f:]+)', line) r'.*link/\S+(?: ([0-9a-f:]+) brd ([0-9a-f:]+))?', line)
flags = match.group(3).split(",") flags = match.group(3).split(",")
i = interface( i = interface(
index = match.group(1), index = match.group(1),
......
...@@ -27,7 +27,7 @@ def process_ipcmd(str): ...@@ -27,7 +27,7 @@ def process_ipcmd(str):
continue continue
# Assume cur is defined # Assume cur is defined
assert cur != None assert cur != None
match = re.search(r'^\s+link/\S* ([0-9a-f:]+)(?: |$)', line) match = re.search(r'^\s+link/\S*(?: ([0-9a-f:]+))?(?: |$)', line)
if match != None: if match != None:
out[cur]['lladdr'] = match.group(1) out[cur]['lladdr'] = match.group(1)
continue continue
...@@ -49,7 +49,7 @@ def process_ipcmd(str): ...@@ -49,7 +49,7 @@ def process_ipcmd(str):
'family': 'inet6'}) 'family': 'inet6'})
continue continue
match = re.search(r'^\s{6}', line) match = re.search(r'^\s{4}', line)
assert match != None assert match != None
return out return out
......
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