diff options
author | George Kraft <george.kraft@calxeda.com> | 2012-09-20 13:18:59 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2012-09-20 13:18:59 -0500 |
commit | 8b10a48e1966c9af46fc0d8b0a7eaa100283ac0a (patch) | |
tree | 64cdb41a4450fb78201867a3679e9f1e3c2a7bb8 | |
parent | 63501cd1fe3883b8cc29db527128c959fe2385ea (diff) | |
download | cxmanage-8b10a48e1966c9af46fc0d8b0a7eaa100283ac0a.tar.gz |
CXMAN-33: Print an appropriate error if IPMItool is missing
-rwxr-xr-x | scripts/cxmanage | 17 |
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) |