From a5adbc1219bcdc240ff27ffde288966580a95653 Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Fri, 15 Mar 2019 14:19:34 +0100 Subject: [PATCH] flatten related services list --- inventory_provider/routes/classifier.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py index bcf80690..7cf5ae0c 100644 --- a/inventory_provider/routes/classifier.py +++ b/inventory_provider/routes/classifier.py @@ -76,10 +76,11 @@ def get_trap_metadata(source_equipment, interface): def _related_services(): for related in related_interfaces(source_equipment, interface): - s = r.get('opsdb:interface_services:%s:%s' + rs = r.get('opsdb:interface_services:%s:%s' % (source_equipment, related)) - if s: - yield json.loads(s.decode('utf-8')) + if rs: + for s in json.loads(rs.decode('utf-8')): + yield s related_services = list(_related_services()) if related_services: -- GitLab