From 6655d6905b05aa2f0811705eedc7243f3b090e93 Mon Sep 17 00:00:00 2001 From: Vidya Ambadipudi <vidya.ambadipudi@geant.org> Date: Thu, 20 Aug 2020 14:16:58 +0200 Subject: [PATCH] added new categories --- inventory_provider/tasks/worker.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py index e23a132f..a299bddc 100644 --- a/inventory_provider/tasks/worker.py +++ b/inventory_provider/tasks/worker.py @@ -691,7 +691,8 @@ class PollerServiceCategory(str, enum.Enum): MDVPN = 'mdvpn' LHCONE_CUST = 'lhcone_cust' LHCONE_PEER = 'lhcone_peer' - L2_Circuits = 'l2_circuits' + L2_CIRCUITS = 'l2_circuits' + AUTOMATED_L2_CIRCUITS = 'automated_l2_circuits' IAS = 'ias' RE_CUST = 're_cust' RE_PEER = 're_peer' @@ -701,21 +702,29 @@ class PollerServiceCategory(str, enum.Enum): def _classify_interface(ifc): if ifc['description'].startswith('SRV_MDVPN CUSTOMER'): yield PollerServiceCategory.MDVPN + if 'LHCONE' in ifc['description'] \ and 'SRV_L3VPN CUSTOMER' in ifc['description']: yield PollerServiceCategory.LHCONE_CUST + if 'LHCONE' in ifc['description'] \ and 'SRV_L3VPN RE' in ifc['description']: yield PollerServiceCategory.LHCONE_PEER - if 'SRV_L2CIRCUIT' in ifc['description'] \ - and 'SRV_L3VPN' in ifc['description']: - yield PollerServiceCategory.L2_Circuits + + if 'SRV_L2CIRCUIT' in ifc['description']: + yield PollerServiceCategory.L2_CIRCUITS + + if 'SRV_GCS' in ifc['description']: + yield PollerServiceCategory.AUTOMATED_L2_CIRCUITS + if 'PHY CUSTOMER' in ifc['description'] \ - and 'LAG CUSTOMER' in ifc['description'] \ - and 'SRV_GLOBAL CUSTOMER' in ifc['description']: + or 'LAG CUSTOMER' in ifc['description'] \ + or 'SRV_GLOBAL CUSTOMER' in ifc['description']: yield PollerServiceCategory.RE_CUST + if 'SRV_GLOBAL RE_INTERCONNECT' in ifc['description']: yield PollerServiceCategory.RE_PEER + if 'SRV_IAS CUSTOMER' in ifc['description']: yield PollerServiceCategory.IAS -- GitLab