Merge pull request #249 from Solvik/fix/hp-raid-ignore-errors

fix: ignore some more hp controllers errors while parsing
This commit is contained in:
Cyril Levis 2022-11-16 10:46:06 +01:00 committed by GitHub
commit 04c1f83e74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: