Skip to content
Snippets Groups Projects
Commit 00b0856e authored by Robert Latta's avatar Robert Latta
Browse files

Merge branch 'feature/debug-incomplete-inventory-update' into develop

parents 07cc5ad9 1c06eb4a
No related branches found
No related tags found
No related merge requests found
......@@ -129,7 +129,10 @@ retrieve_services_query = """SELECT *
AND pp_b.port = cc.port_b
WHERE c.status != 'terminated' AND is_circuit = 1)
AS inner_query
WHERE circuit_type IN ('path', 'service', 'l2circuit')
WHERE
equipment IS NOT NULL
AND equipment != ''
AND circuit_type IN ('path', 'service', 'l2circuit')
ORDER BY
name,
FIELD(status,
......
......@@ -448,6 +448,7 @@ def reload_router_config(self, hostname):
def _derive_router_hostnames(config):
logger = logging.getLogger(__name__)
r = get_redis(config)
junosspace_equipment = set()
for k in r.keys('junosspace:*'):
......@@ -460,8 +461,11 @@ def _derive_router_hostnames(config):
m = re.match(
'opsdb:interface_services:([^:]+):.*$',
k.decode('utf-8'))
opsdb_equipment.add(m.group(1))
if m:
opsdb_equipment.add(m.group(1))
else:
logger.info("Unable to derive router name from %s" %
k.decode('utf-8'))
return junosspace_equipment & opsdb_equipment
......
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