Commit e1a734d6 authored by Simon Redman's avatar Simon Redman

Handle OVS nodes which might have weirdly-handled interfaces

parent 56e49303
......@@ -66,9 +66,9 @@ def parse_ipv4_networks(netgraph):
if interface_name == 'lo':
# Don't mess with the loopback interface
continue
state, *more_states = re.findall(r'\sstate\s+(UP|DOWN)\s+', remainder[0])
state, *more_states = re.findall(r'\sstate\s+([A-Z]+)\s+', remainder[0])
assert len(more_states) == 0, "Should have found only one state"
if state == "DOWN":
if state != "UP":
# Ignore disabled interfaces
continue
# Parse out the ipv4 address. There should be only one.
......@@ -111,9 +111,9 @@ def parse_local_interface_addresses(netgraph):
if interface_name == 'lo':
# Don't mess with the loopback interface
continue
state, *more_states = re.findall(r'\sstate\s+(UP|DOWN)\s+', remainder[0])
state, *more_states = re.findall(r'\sstate\s+([A-Z]+)\s+', remainder[0])
assert len(more_states) == 0, "Should have found only one state"
if state == "DOWN":
if state != "UP":
# Ignore disabled interfaces
continue
# Parse out the link-local ipv6 address. There should be only one.
......@@ -144,6 +144,8 @@ def construct_ULAs(netgraph, ignore_addrs=[]):
ULA_map[host] = {}
for interface in ipv6_link_local_map[host]:
link_local_addr = ipv6_link_local_map[host][interface]
assert host in ipv4_map, "At least the same hosts should be detected for IPv4 and IPv6?"
if not interface in ipv4_map[host]: continue # Some nodes (OVS) do not have IP addresses, so skip them
ipv4_addr = ipv4_map[host][interface]
if (link_local_addr.ip in ignore_addrs or ipv4_addr.ip in ignore_addrs):
# If the IP address should be ignored, ignore it
......
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