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
No related branches found
No related tags found
No related merge requests found
......@@ -38,24 +38,23 @@ def _location_from_router(router_name):
result = r.get(f'opsdb:location:{router_name}')
if not result:
logger.error(f'error looking up location for {router_name}')
return None
# return {
# 'a': _LOCATION(
# equipment=router_name,
# name='?',
# abbreviation='?')
# }
return {
'a': _LOCATION(
equipment=router_name,
name='?',
abbreviation='?')
}
result = json.loads(result.decode('utf-8'))
if not result:
logger.error(f'sanity failure: empty list for location {router_name}')
return None
# return {
# 'a': _LOCATION(
# equipment=router_name,
# name='?',
# abbreviation='?')
# }
return {
'a': _LOCATION(
equipment=router_name,
name='?',
abbreviation='?')
}
return {
'a': _LOCATION(
......
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