Skip to content
Snippets Groups Projects
Commit 9d9dbbfc authored by Saket Agrahari's avatar Saket Agrahari
Browse files

Finished feature LG-46-in-service-router.

parents 5098d204 f80afb15
No related branches found
No related tags found
No related merge requests found
......@@ -437,7 +437,9 @@ def lookup_lg_routers(ds: IMS):
pattern = re.compile("vpn-proxy|vrr|taas", re.IGNORECASE)
def _matching_node(node_):
if InventoryStatus(node_['inventorystatusid']) in STATUSES_TO_IGNORE:
# [LG-46]
if InventoryStatus(node_['inventorystatusid']) \
!= InventoryStatus.IN_SERVICE:
return False
if pattern.match(node_['name']):
......@@ -462,7 +464,8 @@ def lookup_lg_routers(ds: IMS):
for node in nodes:
if not _matching_node(node):
continue
if node['inventorystatusid'] in STATUSES_TO_IGNORE:
# [LG - 46]
if node['inventorystatusid'] != InventoryStatus.IN_SERVICE.value:
continue
site = ds.get_entity_by_id('Site', node['siteid'], site_nav_props,
......
......@@ -266,8 +266,8 @@ def test_lookup_lg_routers(mocker):
'Name like MX',
inventory_provider.db.ims.EQUIP_DEF_PROPERTIES['Nodes'])
assert ds.get_entity_by_id.call_count == 36
assert len(res) == 36
assert ds.get_entity_by_id.call_count == 35
assert len(res) == 35
pop = {
'name': 'pop name',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment