diff options
author | dlynch <david.lynch@calxeda.com> | 2013-08-29 16:24:06 -0500 |
---|---|---|
committer | dlynch <david.lynch@calxeda.com> | 2013-08-29 16:24:06 -0500 |
commit | 0edbe7fa94363bc139e69fa99ffda7bb434c9d45 (patch) | |
tree | 1240fe637a58d0e44045bf12e92dd9ec857c509d | |
parent | 3988b859b0b874f0960662a8c216e0e8ee51e25d (diff) | |
download | cxmanage-0edbe7fa94363bc139e69fa99ffda7bb434c9d45.tar.gz |
Added win32 version check
-rwxr-xr-x | scripts/cxmanage | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/scripts/cxmanage b/scripts/cxmanage index ce7748c..5ca5971 100755 --- a/scripts/cxmanage +++ b/scripts/cxmanage @@ -336,40 +336,41 @@ def print_version(): def check_versions(): """Check versions of dependencies""" # Check pyipmi version - try: - pkg_resources.require('pyipmi>=%s' % PYIPMI_VERSION) - except pkg_resources.DistributionNotFound: - print 'ERROR: cxmanage requires pyipmi version %s'\ - % PYIPMI_VERSION - print 'No existing version was found.' - sys.exit(1) - except pkg_resources.VersionConflict: - version = pkg_resources.require('pyipmi')[0].version - print 'ERROR: cxmanage requires pyipmi version %s' % PYIPMI_VERSION - print 'Current pyipmi version is %s' % version - sys.exit(1) - - - # Check ipmitool version - if 'IPMITOOL_PATH' in os.environ: - args = [os.environ['IPMITOOL_PATH'], '-V'] - else: - args = ['ipmitool', '-V'] - - try: - ipmitool_process = subprocess.Popen(args, stdout=subprocess.PIPE) - ipmitool_version = ipmitool_process.communicate()[0].split()[2] - if pkg_resources.parse_version(ipmitool_version) < \ - pkg_resources.parse_version(IPMITOOL_VERSION): + if sys.platform != 'win32': + try: + pkg_resources.require('pyipmi>=%s' % PYIPMI_VERSION) + except pkg_resources.DistributionNotFound: + print 'ERROR: cxmanage requires pyipmi version %s'\ + % PYIPMI_VERSION + print 'No existing version was found.' + sys.exit(1) + except pkg_resources.VersionConflict: + version = pkg_resources.require('pyipmi')[0].version + print 'ERROR: cxmanage requires pyipmi version %s' % PYIPMI_VERSION + print 'Current pyipmi version is %s' % version + sys.exit(1) + + + # Check ipmitool version + if 'IPMITOOL_PATH' in os.environ: + args = [os.environ['IPMITOOL_PATH'], '-V'] + else: + args = ['ipmitool', '-V'] + + try: + ipmitool_process = subprocess.Popen(args, stdout=subprocess.PIPE) + ipmitool_version = ipmitool_process.communicate()[0].split()[2] + if pkg_resources.parse_version(ipmitool_version) < \ + pkg_resources.parse_version(IPMITOOL_VERSION): + print 'ERROR: cxmanage requires IPMItool %s or later' \ + % IPMITOOL_VERSION + print 'Current IPMItool version is %s' % ipmitool_version + sys.exit(1) + except OSError: print 'ERROR: cxmanage requires IPMItool %s or later' \ % IPMITOOL_VERSION - print 'Current IPMItool version is %s' % ipmitool_version + print 'No existing version was found.' sys.exit(1) - except OSError: - print 'ERROR: cxmanage requires IPMItool %s or later' \ - % IPMITOOL_VERSION - print 'No existing version was found.' - sys.exit(1) def main(): |