summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthew.hodgins <matthew.hodgins@calxeda.com>2013-11-08 15:34:59 -0600
committermatthew.hodgins <matthew.hodgins@calxeda.com>2013-11-08 15:36:29 -0600
commitc14717e81182c31d66c31b061f71ffc658cf2e3f (patch)
treee84e7594132c67c89daf334e8fddf02a4ba16a30
parent044eb7e045ff24cd951ddf697f06644d5085d2a8 (diff)
downloadcxmanage-c14717e81182c31d66c31b061f71ffc658cf2e3f.tar.gz
AIT-528 raise an exception when ipmitool_command returns with non-zero
Signed-off-by: matthew.hodgins <matthew.hodgins@calxeda.com>
-rw-r--r--cxmanage_api/node.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py
index 0977bf1..834a900 100644
--- a/cxmanage_api/node.py
+++ b/cxmanage_api/node.py
@@ -1123,6 +1123,8 @@ communication.
:param ipmitool_args: Arguments to pass to the ipmitool.
:type ipmitool_args: list
+
+ :raises IpmiError: If the IPMI command fails.
"""
if ("IPMITOOL_PATH" in os.environ):
@@ -1140,6 +1142,8 @@ communication.
process = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
+ if(process.returncode != 0):
+ raise IpmiError('IPMI command returned with non-zero exit code')
return (stdout + stderr).strip()
def get_ubootenv(self):