From b6eda6d7e33a17d0f9f2e494e46a45dbca8d1f3c Mon Sep 17 00:00:00 2001 From: Bjarke Madsen <bjarke.madsen@geant.org> Date: Wed, 18 Aug 2021 11:26:11 +0200 Subject: [PATCH] refactor check to use regex --- inventory_provider/routes/poller.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/inventory_provider/routes/poller.py b/inventory_provider/routes/poller.py index 20871845..3abd16b8 100644 --- a/inventory_provider/routes/poller.py +++ b/inventory_provider/routes/poller.py @@ -429,9 +429,7 @@ def _get_dashboards(interface): yield BRIAN_DASHBOARDS.IAS_CUSTOMER if 'SRV_IAS UPSTREAM' in description: yield BRIAN_DASHBOARDS.IAS_UPSTREAM - if 'SRV_GLOBAL RE_INTERCONNECT' in description or \ - 'LAG RE_INTERCONNECT' in description or \ - 'SRV_L3VPN RE_INTERCONNECT' in description: + if re.match('(SRV_GLOBAL|SRV_L3VPN|LAG) RE_INTERCONNECT', description): yield BRIAN_DASHBOARDS.RE_PEER if re.match(r'(PHY|LAG|SRV_GLOBAL) CUSTOMER', description): yield BRIAN_DASHBOARDS.RE_CUST -- GitLab