diff --git a/inventory_provider/db/opsdb.py b/inventory_provider/db/opsdb.py index 2768a9ed93549420757e9743dd9c023716bc6a6b..ac8958a5ca816583b60d8bf9829119541fb7aca7 100644 --- a/inventory_provider/db/opsdb.py +++ b/inventory_provider/db/opsdb.py @@ -410,7 +410,7 @@ WHERE e.manufacturer = 'Juniper' AND e.status = 'Operational' AND o.name = 'DANTE / GEANT' - AND NOT (e.name REGEXP 'vpn-proxy|vrr|taas') + AND NOT (e.name REGEXP 'vpn-proxy|vrr|taas|junosspace') """ def _public(row): @@ -421,6 +421,8 @@ WHERE if row['pop_city'].lower() == 'slough' \ and not row['equipment_model'].upper().startswith('MX'): return False + if row['router_name'].startswith('srx'): + return False return True def _row2rsp(row): diff --git a/test/test_opsdb_queries.py b/test/test_opsdb_queries.py index eb347d9f993eea6e057dfd8e579d4a33cde8cb75..021a2adda1cc9429993cad268f55c3e8e557b3fd 100644 --- a/test/test_opsdb_queries.py +++ b/test/test_opsdb_queries.py @@ -291,6 +291,13 @@ def test_lookup_lg_routers(connection, cached_test_data): lambda r: r['equipment name'].startswith('sw'), routers) assert all(s['type'] == 'INTERNAL' for s in switches) + assert not any( + r['equipment name'].lower().startswith('junosspace') for r in routers) + + srx = filter( + lambda r: r['equipment name'].lower().startswith('srx'), routers) + assert all(s['type'] == 'INTERNAL' for s in srx) + CIRCUIT_INFO_SCHEMA = { "$schema": "http://json-schema.org/draft-07/schema#",