diff --git a/Changelog.md b/Changelog.md index 1b882357019522231ea6e6fd80dbe8141b22771f..87a6645aa0f7fc08c3ef57c5d9f765cec10d0f5d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [0.88] - 2022-06-22 +- DBOARD3-596: Only include contacts with populated mail value +- LG-46: Showing 'in-service' routers only + ## [0.87] - 2022-06-15 - POL1-526: added bgp all peerings endpoint for msr - POL1-526: return list of BRIAN dashboard info (one for each customer) diff --git a/inventory_provider/db/ims_data.py b/inventory_provider/db/ims_data.py index 2d616f09b419584365701802bec1ba87ac795ee6..308ba5a894a35b7e03ec2d539021bb0b91b8fd90 100644 --- a/inventory_provider/db/ims_data.py +++ b/inventory_provider/db/ims_data.py @@ -111,13 +111,13 @@ def get_customer_service_emails(ds: IMS): customer_contacts = defaultdict(set) for x in ds.get_filtered_entities( 'customerrelatedcontact', - "contact.plannedworkmail != ''", + "contact.plannedworkmail != '' | contact.mail != ''", CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact'] ): customer_contacts[x['customerid']].add(x['contact']['mail']) for x in ds.get_filtered_entities( 'customerrelatedcontact', - "contact.troubleticketMail != ''", + "contact.troubleticketMail != '' | contact.mail != ''", CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact'] ): customer_contacts[x['customerid']].add(x['contact']['mail']) @@ -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, diff --git a/setup.py b/setup.py index 18298bf079a54b48149f54e4d248dc6eedfcfc79..9c5943c14756991386a4d588b53922312a512c60 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='inventory-provider', - version="0.87", + version="0.88", author='GEANT', author_email='swd@geant.org', description='Dashboard inventory provider', diff --git a/test/test_ims_data.py b/test/test_ims_data.py index 69d0737a03191c9f3466b86241a8401964605db8..2a12e0dbb09163b22e805ac2cac7b56111c825ea 100644 --- a/test/test_ims_data.py +++ b/test/test_ims_data.py @@ -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',