Skip to content
Snippets Groups Projects
Commit 8547da58 authored by Erik Reid's avatar Erik Reid
Browse files

remove assumption that interface name doesn't contain ':'

parent 3bf799af
No related branches found
No related tags found
No related merge requests found
......@@ -18,12 +18,17 @@ def build_service_interface_user_list(config):
r = get_next_redis(config)
for k in r.scan_iter('netconf-interfaces:*'):
k = k.decode('utf-8')
(_, router_name, ifc_name) = k.split(':')
m = re.match('^netconf-interfaces:([^:]+):(.+)$', k)
if not m:
logger.error('invalid redis key: "{k}"')
continue # skip, rather than fail the entire update
router_name = m.group(1)
ifc_name = m.group(2)
info = r.get(k).decode('utf-8')
info = json.loads(info)
assert ifc_name == info['name']
assert ifc_name == info['name'] # sanity
yield {
'router': router_name,
'interface': info['name'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment