diff --git a/Changelog.md b/Changelog.md index 76aadb8dbaf97ca31b0e6b7d88c19171641ceaec..f9580f7441ce1d4f437a2f1bf3c244e4c1a92b37 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [0.125] - 2024-07-18 +- DBOARD3-971: Added handling for GRV 10G interfaces +- POL1-836: Included PHY RE_INTERCONNECT in R&E Peer dashboards + ## [0.124] - 2024-07-11 - DBOARD3-921: GAP/InventoryProvider integration - Updated Nokia parsing and tests diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py index 4c9dcd63fd02262540618200656b4ff1bb009d1d..61e6bdacdf9dfc13e758eba86a98816c51f526c1 100644 --- a/inventory_provider/routes/classifier.py +++ b/inventory_provider/routes/classifier.py @@ -1013,7 +1013,7 @@ def get_coriant_info(equipment_name: str, entity_string: str) -> Response: if not result: - m = re.match(r'^(\d+\-\d+)\.(\d+)', ims_interface) + m = re.match(r'^(\d+\-\d+)\.((\d+)(\.\d+)*)', ims_interface) if not m: logger.error( f'invalid coriant entity string format: {ims_interface}') diff --git a/inventory_provider/routes/poller.py b/inventory_provider/routes/poller.py index e89a977eaae04a65271caee32cc30f33a5a96c25..284e7b711a5ac87c7600a80335409bf3fbf5ddce 100644 --- a/inventory_provider/routes/poller.py +++ b/inventory_provider/routes/poller.py @@ -481,7 +481,7 @@ def _get_dashboards(interface): yield BRIAN_DASHBOARDS.IAS_UPSTREAM if re.match(r'SRV_10GGBS CUSTOMER\s', description): yield BRIAN_DASHBOARDS.GBS_10G - if re.match(r'(SRV_GLOBAL|SRV_L3VPN|LAG) RE_INTERCONNECT\s', description): + if re.match(r'(SRV_GLOBAL|SRV_L3VPN|LAG|PHY) RE_INTERCONNECT\s', description): yield BRIAN_DASHBOARDS.RE_PEER if re.match(r'(PHY|LAG|SRV_GLOBAL) CUSTOMER\s', description): yield BRIAN_DASHBOARDS.RE_CUST diff --git a/requirements.txt b/requirements.txt index 0b3553d28a2e56048837ab217fc6e9bee92963fe..0d226651b91236f8b7bd716d444d6d71eb3c1d0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ click mysql-connector -pysnmp +pysnmp==4.4.12 pyasn1==0.4.8 jsonschema paramiko @@ -24,4 +24,4 @@ sphinx sphinx-rtd-theme # glitchtip/sentry integration -sentry-sdk[flask,celery] \ No newline at end of file +sentry-sdk[flask,celery] diff --git a/setup.py b/setup.py index 2eff396a2ed639146f82f6c675f23049e65fbc2d..7acff57953d7563ff4b789431c6d2019dd470ef0 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='inventory-provider', - version="0.124", + version="0.125", author='GEANT', author_email='swd@geant.org', description='Dashboard inventory provider', @@ -13,7 +13,7 @@ setup( 'click', 'mysql-connector', 'pyasn1==0.4.8', - 'pysnmp', + 'pysnmp==4.4.12', 'jsonschema', 'paramiko', 'flask', diff --git a/test/test_classifier_routes.py b/test/test_classifier_routes.py index c49f7124d177fb598265a2d3e99a5228042cc476..93a12882c21173e5d62d5752e1772be63e50d436 100644 --- a/test/test_classifier_routes.py +++ b/test/test_classifier_routes.py @@ -121,12 +121,12 @@ def test_peer_not_found(client): assert response_data == {'locations': [], "contacts": []} -@pytest.mark.parametrize('equipment,entity_name', [ - ('grv3.ams.nl.geant.net', '1-1.3.1-100GbE-ODU4-TTP1'), +@pytest.mark.parametrize('equipment,entity_name,expected_card_id,expected_port', [ + ('grv3.ams.nl.geant.net', '1-3.3.1-Optical-10GbE-TTP', '1/3', '3.1'), ('bogus-hostname.with&special.char', - '234-2345234.7878i234crazynamewithslash/1-2.3') + '234-2345234.7878i234crazynamewithslash/1-2.3', '234/2345234', '7878') ]) -def test_coriant_info(client, equipment, entity_name): +def test_coriant_info(client, equipment, entity_name, expected_card_id, expected_port): rv = client.get( f'/classifier/coriant-info/{equipment}/{entity_name}', headers=DEFAULT_REQUEST_HEADERS) @@ -134,6 +134,8 @@ def test_coriant_info(client, equipment, entity_name): assert rv.is_json response_data = json.loads(rv.data.decode('utf-8')) jsonschema.validate(response_data, CORIANT_INFO_RESPONSE_SCHEMA) + assert response_data['card id'] == expected_card_id + assert response_data['port number'] == expected_port def test_coriant_info_not_found(client):