summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2012-09-20 13:18:59 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2012-09-20 13:18:59 -0500
commit8b10a48e1966c9af46fc0d8b0a7eaa100283ac0a (patch)
tree64cdb41a4450fb78201867a3679e9f1e3c2a7bb8
parent63501cd1fe3883b8cc29db527128c959fe2385ea (diff)
downloadcxmanage-8b10a48e1966c9af46fc0d8b0a7eaa100283ac0a.tar.gz
CXMAN-33: Print an appropriate error if IPMItool is missing
-rwxr-xr-xscripts/cxmanage17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/cxmanage b/scripts/cxmanage
index e6d6287..f7d95a2 100755
--- a/scripts/cxmanage
+++ b/scripts/cxmanage
@@ -303,11 +303,18 @@ def check_versions():
args = [os.environ['IPMITOOL_PATH'], '-V']
else:
args = ['ipmitool', '-V']
- ipmitool_process = subprocess.Popen(args, stdout=subprocess.PIPE)
- ipmitool_version = ipmitool_process.communicate()[0].split()[2]
- if not '-cx' in ipmitool_version:
- print 'ERROR: cxmanage is not compatible with IPMItool version %s\n'\
- % ipmitool_version
+
+ try:
+ ipmitool_process = subprocess.Popen(args, stdout=subprocess.PIPE)
+ ipmitool_version = ipmitool_process.communicate()[0].split()[2]
+ if not '-cx' in ipmitool_version:
+ print 'ERROR: cxmanage is not compatible with IPMItool version %s\n'\
+ % ipmitool_version
+ print 'Please make sure a Calxeda extended version of IPMItool is available'
+ print 'in your PATH, or point to one with the --ipmipath argument.'
+ sys.exit(1)
+ except OSError:
+ print 'ERROR: cxmanage failed to find IPMItool.\n'
print 'Please make sure a Calxeda extended version of IPMItool is available'
print 'in your PATH, or point to one with the --ipmipath argument.'
sys.exit(1)