From 9b06584fed964aca462e309ad86486d4a174fd43 Mon Sep 17 00:00:00 2001 From: Cyril Levis Date: Wed, 16 Nov 2022 10:45:25 +0100 Subject: [PATCH] fix: ignore some more hp controllers errors while parsing --- netbox_agent/raid/hp.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/netbox_agent/raid/hp.py b/netbox_agent/raid/hp.py index 81f2ab9..610c958 100644 --- a/netbox_agent/raid/hp.py +++ b/netbox_agent/raid/hp.py @@ -36,9 +36,14 @@ def ssacli(sub_command): def _parse_ctrl_output(lines): controllers = {} current_ctrl = None - + ignore_patterns = ['Note:', 'Error:', 'is not loaded', 'README'] + ignore_match = False for line in lines: - if not line or line.startswith('Note:'): + for pattern in ignore_patterns: + if not line or pattern in line: + ignore_match = True + break + if ignore_match: continue ctrl = REGEXP_CONTROLLER_HP.search(line) if ctrl is not None: