diff --git a/inventory_provider/routes/poller.py b/inventory_provider/routes/poller.py index 66a10d18b5447a27fede2a8eb37fc580c027b26b..775c4e57dcf0e4ad968f3cc130f6e19704e786f1 100644 --- a/inventory_provider/routes/poller.py +++ b/inventory_provider/routes/poller.py @@ -853,7 +853,7 @@ def interface_speed(ifc): if ifc_name.startswith('xe'): return 10 * Gb if ifc_name.startswith('et'): - return 100 * Gb + return 400 * Gb logger.warning(f'unrecognized interface name: {ifc_name}') return -1 diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py index f9b1e36b0ece9857c254da5a4c14e628fda41bb9..a3b96c6d9691b3b58cf15a5cf45ae7ac3e360ec0 100644 --- a/inventory_provider/tasks/worker.py +++ b/inventory_provider/tasks/worker.py @@ -1110,16 +1110,26 @@ def transform_ims_data(data): node_pair_services[ f"{circ['equipment']}/{circ['other_end_equipment']}" ][circ['id']] = circ + try: + # get the physical port circuit, if it exists + # https://jira.software.geant.org/browse/POL1-687 + port_circuit = next( + c for c in circuits if c.get('port_type') == 'ports') + except StopIteration: + port_circuit = None sid = None if circ['id'] in circuit_ids_and_sids: sid = circuit_ids_and_sids[circ['id']] - elif 'sid' in details: if len(circuits) > 1: - # we don't know which circuit - # to give the SID in this case, so skip - continue + if port_circuit != circ: + # if this is not the physical port circuit + # related to this port, then we don't want to + # assign the SID to this circuit, so skip. + continue + + # assign the SID from the port to this circuit sid = details['sid'] if sid is None: diff --git a/requirements.txt b/requirements.txt index 949b83d8a8781bf7ceb7685c45d48667aa95a358..c0363183d57c245b2335c6db846c403b9bd7ae05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ click mysql-connector pysnmp +pyasn1==0.4.8 jsonschema==3.2.0 paramiko flask diff --git a/setup.py b/setup.py index 0cc25fe475947f1c97f1efc86dcfe6f036e76679..034ceb0f501656248b241ebae6aa99120486a3f5 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='inventory-provider', - version="0.101", + version="0.102", author='GEANT', author_email='swd@geant.org', description='Dashboard inventory provider', @@ -12,6 +12,7 @@ setup( install_requires=[ 'click', 'mysql-connector', + 'pyasn1==0.4.8', 'pysnmp', 'jsonschema==3.2.0', 'paramiko',