Skip to content
Snippets Groups Projects
Commit f60beee2 authored by Erik Reid's avatar Erik Reid
Browse files

Finished feature LGR-73.

parents c36da748 ffd05854
No related branches found
No related tags found
No related merge requests found
...@@ -414,15 +414,20 @@ WHERE ...@@ -414,15 +414,20 @@ WHERE
""" """
def _public(row): def _public(row):
# cf. LGR-73
if row['pop_name'] in INTERNAL_POP_NAMES: if row['pop_name'] in INTERNAL_POP_NAMES:
return False 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 return False
if row['pop_city'].lower() == 'slough' \ if row['pop_city'].lower() == 'slough' \
and not row['equipment_model'].upper().startswith('MX'): and not row['equipment_model'].upper().startswith('MX'):
return False return False
if row['router_name'].startswith('srx'):
return False
return True return True
def _row2rsp(row): def _row2rsp(row):
......
...@@ -294,9 +294,12 @@ def test_lookup_lg_routers(connection, cached_test_data): ...@@ -294,9 +294,12 @@ def test_lookup_lg_routers(connection, cached_test_data):
assert not any( assert not any(
r['equipment name'].lower().startswith('junosspace') for r in routers) r['equipment name'].lower().startswith('junosspace') for r in routers)
srx = filter( internal_prefix_patterns = ['srx', 'gts', 'qfx']
lambda r: r['equipment name'].lower().startswith('srx'), routers) for prefix in internal_prefix_patterns:
assert all(s['type'] == 'INTERNAL' for s in srx) filtered = filter(
lambda r: r['equipment name'].lower().startswith(prefix), routers)
assert all(r['type'] == 'INTERNAL' for r in filtered), \
f'not all {prefix}* routers are INTERNAL'
CIRCUIT_INFO_SCHEMA = { CIRCUIT_INFO_SCHEMA = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment