Commit 69be7d3d authored by Martín Ferrari's avatar Martín Ferrari

Manage change in iproute output for linked interfaces.

parent 60a471f6
...@@ -308,8 +308,9 @@ def get_if_data(): ...@@ -308,8 +308,9 @@ def get_if_data():
continue continue
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+)?: <(\S+)> mtu (\d+) '
r'.*link/\S+(?: ([0-9a-f:]+) brd ([0-9a-f:]+))?', line) r'qdisc \S+.*link/\S+(?: ([0-9a-f:]+) '
r'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),
...@@ -431,7 +432,7 @@ def get_addr_data(): ...@@ -431,7 +432,7 @@ def get_addr_data():
for line in ipdata.split("\n"): for line in ipdata.split("\n"):
if line == "": if line == "":
continue continue
match = re.search(r'^(\d+):\s+(\S+):', line) match = re.search(r'^(\d+):\s+([^@\s]+)(?:@\S+)?:', line)
if match: if match:
# First line of output. # First line of output.
idx = int(match.group(1)) idx = int(match.group(1))
......
...@@ -12,7 +12,8 @@ def process_ipcmd(str): ...@@ -12,7 +12,8 @@ def process_ipcmd(str):
if line == "": if line == "":
cur = None cur = None
continue continue
match = re.search(r'^(\d+): (\S+): <(\S+)> mtu (\d+) qdisc (\S+)', match = re.search(r'^(\d+): ([^@\s]+)(?:@\S+)?: <(\S+)> mtu (\d+) '
r'qdisc (\S+)',
line) line)
if match != None: if match != None:
cur = match.group(2) cur = match.group(2)
......
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