Merge pull request #220 from cyrinux/fix/hp-raid
fix: hp raid, prevent us to miss some errors
This commit is contained in:
commit
6181800cb3
1 changed files with 2 additions and 2 deletions
|
|
@ -20,13 +20,13 @@ def ssacli(sub_command):
|
||||||
)
|
)
|
||||||
p.wait()
|
p.wait()
|
||||||
stdout = p.stdout.read().decode("utf-8")
|
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(
|
mesg = "Failed to execute command '{}':\n{}".format(
|
||||||
" ".join(command), stdout
|
" ".join(command), stdout
|
||||||
)
|
)
|
||||||
raise HPRaidControllerError(mesg)
|
raise HPRaidControllerError(mesg)
|
||||||
else:
|
else:
|
||||||
if stdout.find('does not have any physical') != -1:
|
if 'does not have any physical' in stdout:
|
||||||
return list()
|
return list()
|
||||||
else:
|
else:
|
||||||
lines = stdout.split('\n')
|
lines = stdout.split('\n')
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue