Skip to content

Commit

Permalink
Merge pull request #220 from cyrinux/fix/hp-raid
Browse files Browse the repository at this point in the history
fix: hp raid, prevent us to miss some errors
  • Loading branch information
cyrinux authored Apr 6, 2022
2 parents 5f0aae6 + 2f23844 commit 6181800
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netbox_agent/raid/hp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def ssacli(sub_command):
)
p.wait()
stdout = p.stdout.read().decode("utf-8")
if p.returncode == 1 and stdout.find('does not have any physical') == -1:
if p.returncode != 0 and 'does not have any physical' not in stdout:
mesg = "Failed to execute command '{}':\n{}".format(
" ".join(command), stdout
)
raise HPRaidControllerError(mesg)
else:
if stdout.find('does not have any physical') != -1:
if 'does not have any physical' in stdout:
return list()
else:
lines = stdout.split('\n')
Expand Down

0 comments on commit 6181800

Please sign in to comment.