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

return dummy location data for unknown routers

parent 8c07c075
Branches
Tags
No related merge requests found
...@@ -38,24 +38,23 @@ def _location_from_router(router_name): ...@@ -38,24 +38,23 @@ def _location_from_router(router_name):
result = r.get(f'opsdb:location:{router_name}') result = r.get(f'opsdb:location:{router_name}')
if not result: if not result:
logger.error(f'error looking up location for {router_name}') logger.error(f'error looking up location for {router_name}')
return None return {
# return { 'a': _LOCATION(
# 'a': _LOCATION( equipment=router_name,
# equipment=router_name, name='?',
# name='?', abbreviation='?')
# abbreviation='?') }
# }
result = json.loads(result.decode('utf-8')) result = json.loads(result.decode('utf-8'))
if not result: if not result:
logger.error(f'sanity failure: empty list for location {router_name}') logger.error(f'sanity failure: empty list for location {router_name}')
return None return None
# return { return {
# 'a': _LOCATION( 'a': _LOCATION(
# equipment=router_name, equipment=router_name,
# name='?', name='?',
# abbreviation='?') abbreviation='?')
# } }
return { return {
'a': _LOCATION( 'a': _LOCATION(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment