From 167955ed18930d5ea6d80ef459247d72fda83eaf Mon Sep 17 00:00:00 2001
From: Robert Latta <robert.latta@geant.org>
Date: Mon, 8 Mar 2021 10:43:27 +0000
Subject: [PATCH] added check for key

---
 inventory_provider/routes/classifier.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py
index 9980cbc1..052930df 100644
--- a/inventory_provider/routes/classifier.py
+++ b/inventory_provider/routes/classifier.py
@@ -146,6 +146,17 @@ def get_top_level_services(circuit_id: str, r: Redis) -> List[dict]:
         results = json.loads(results.decode('utf-8'))
 
         def _is_tls(candidate):
+            if 'circuit-type' in candidate:
+                if candidate['product'] == 'IP PEERING - NON R&E (PUBLIC)':
+                    return False
+                if candidate['circuit-type'] == 'service':
+                    return True
+                if candidate['speed'] == 'BGP':
+                    return True
+
+            # this will be obsolete as soon as Inventory Provider
+            # update is done, but is here for between the time of the roll out
+            # and the Inventory Update
             tls_names = copy(IMS_SERVICE_NAMES)
 
             # whilst this is a service type the top level for reporting
-- 
GitLab