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

save list of locations to redis cache

parent bc4f8547
No related branches found
No related tags found
No related merge requests found
......@@ -146,8 +146,10 @@ def update_equipment_locations():
with db.connection(InventoryTask.config["ops-db"]) as cx:
for h in _derive_router_hostnames(InventoryTask.config):
for ld in opsdb.lookup_pop_info(cx, h):
r.set('opsdb:location:%s' % h, json.dumps(ld))
# lookup_pop_info returns a list of locations
# (there can sometimes be more than one match)
locations = list(opsdb.lookup_pop_info(cx, h))
r.set('opsdb:location:%s' % h, json.dumps(locations))
logger.debug('<<< update_equipment_locations')
......
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