fix: handle big list of hp disk
we cant use p.wait() if too much data.
This commit is contained in:
parent
a9af96bba2
commit
cedb6818a3
1 changed files with 9 additions and 9 deletions
|
@ -18,14 +18,14 @@ def ssacli(sub_command):
|
|||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT
|
||||
)
|
||||
p.wait()
|
||||
stdout = p.stdout.read().decode("utf-8")
|
||||
if p.returncode != 0 and 'does not have any physical' not in stdout:
|
||||
stdout, stderr = p.communicate()
|
||||
stdout = stdout.decode("utf-8")
|
||||
if p.returncode != 0:
|
||||
mesg = "Failed to execute command '{}':\n{}".format(
|
||||
" ".join(command), stdout
|
||||
)
|
||||
raise HPRaidControllerError(mesg)
|
||||
else:
|
||||
|
||||
if 'does not have any physical' in stdout:
|
||||
return list()
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue