From c14717e81182c31d66c31b061f71ffc658cf2e3f Mon Sep 17 00:00:00 2001 From: "matthew.hodgins" Date: Fri, 8 Nov 2013 15:34:59 -0600 Subject: AIT-528 raise an exception when ipmitool_command returns with non-zero Signed-off-by: matthew.hodgins --- cxmanage_api/node.py | 4 ++++ 1 file changed, 4 insertions(+) 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): -- cgit v1.2.1