diff --git a/inventory_provider/db/opsdb.py b/inventory_provider/db/opsdb.py index ac8958a5ca816583b60d8bf9829119541fb7aca7..cdf49bdc947cb282b5e86093dee0f5448d5708f7 100644 --- a/inventory_provider/db/opsdb.py +++ b/inventory_provider/db/opsdb.py @@ -414,15 +414,20 @@ WHERE """ def _public(row): + # cf. LGR-73 + if row['pop_name'] in INTERNAL_POP_NAMES: return False - if row['router_name'].startswith('sw'): + + router_name_lower = row['router_name'].lower() + if any(router_name_lower.startswith(prefix) + for prefix in ['srx', 'gts', 'sw', 'qfx']): return False + 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):