Merge pull request #253 from Solvik/fix/cle/storcli-inventory

fix: deadlock storcli inventory
This commit is contained in:
Cyril Levis 2022-11-30 09:52:03 +01:00 committed by GitHub
commit ba0be73d3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,14 +21,17 @@ def storecli(sub_command):
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
p.wait()
stdout = p.stdout.read().decode("utf-8")
if p.returncode != 0:
stdout, stderr = p.communicate()
if stderr:
mesg = "Failed to execute command '{}':\n{}".format(
" ".join(command), stdout
)
raise StorcliControllerError(mesg)
stdout = stdout.decode("utf-8")
data = json.loads(stdout)
controllers = dict([
(
c['Command Status']['Controller'],