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
"""
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):
......
......@@ -294,9 +294,12 @@ def test_lookup_lg_routers(connection, cached_test_data):
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)
internal_prefix_patterns = ['srx', 'gts', 'qfx']
for prefix in internal_prefix_patterns:
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 = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment