diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py index c38f0474cf6bd9182ee56ae61750a4a5a5451201..995574e749edb2e800108b400c64878c663b0611 100644 --- a/inventory_provider/tasks/worker.py +++ b/inventory_provider/tasks/worker.py @@ -699,6 +699,7 @@ class PollerServiceCategory(str, enum.Enum): def _classify_interface(ifc): + if ifc['description'].startswith('SRV_MDVPN CUSTOMER'): yield PollerServiceCategory.MDVPN diff --git a/test/test_worker_utils.py b/test/test_worker_utils.py index aa9f03ec60e512e993a9e207328e9ad030448f7d..20f22a783b1429242318eae78b16ea789a8c4ca3 100644 --- a/test/test_worker_utils.py +++ b/test/test_worker_utils.py @@ -139,34 +139,41 @@ def test_build_subnet_db(mocked_worker_module): } ], [ - 'SRV_L3VPN CUSTOMER ESNET LHCONE SRF9928635 | ASN293 | GEN-EEX-ESNET-LHCONE', # noqa + 'SRV_L3VPN CUSTOMER ESNET LHCONE SRF9928635 | ASN293 | GEN-EEX-ESNET-LHCONE', { worker.PollerServiceCategory.LHCONE_CUST } ], [ - 'SRV_L3VPN RE KREONET LHCONE SRF17072 | ASN17579', # noqa + 'SRV_L3VPN RE KREONET LHCONE SRF17072 | ASN17579', { worker.PollerServiceCategory.LHCONE_PEER } ], [ - 'SRV_IAS CUSTOMER ACONET SRF9947199 IASPS | ASN1853', # noqa + 'SRV_IAS CUSTOMER ACONET SRF9947199 IASPS | ASN1853', { worker.PollerServiceCategory.IAS } ], [ - 'SRV_GLOBAL CUSTOMER HBKU SRF18085 | ASN34945|', # noqa + 'SRV_GLOBAL CUSTOMER HBKU SRF18085 | ASN34945|', { worker.PollerServiceCategory.RE_CUST } ], [ - 'SRV_GLOBAL RE_INTERCONNECT HBKU SRF18085 | ASN34945|', # noqa + 'SRV_GLOBAL RE_INTERCONNECT HBKU SRF18085 | ASN34945|', { worker.PollerServiceCategory.RE_PEER } + ], + [ + 'SRV_MDVPN CUSTOMER LHCONE SRV_L3VPN CUSTOMER SRF18085 | ASN34945|', + { + worker.PollerServiceCategory.MDVPN, + worker.PollerServiceCategory.LHCONE_CUST + } ] ]) def test_interface_classification(description, expected_categories):