diff options
author | George Kraft <george.kraft@calxeda.com> | 2012-08-17 15:00:55 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2012-08-17 15:00:55 -0500 |
commit | 1e7d6bdc75dd56a6a0152e79a7b49089033a67de (patch) | |
tree | b0c82989243f67925872e9f0e519a2c879a6c2f2 | |
parent | 45edad13976baa11c56917ad2b26afaefa1a9632 (diff) | |
download | cxmanage-1e7d6bdc75dd56a6a0152e79a7b49089033a67de.tar.gz |
cxmanage: Add --ipmipath option
For specifying a path to ipmitool. Can be a directory or a direct
path. For example, both of these will work:
cxmanage --ipmipath /usr/bin fwinfo 192.168.100.250
cxmanage --ipmipath /usr/bin/ipmitool fwinfo 192.168.100.250
-rwxr-xr-x | scripts/cxmanage | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/cxmanage b/scripts/cxmanage index 8a9d7c9..e5687f0 100755 --- a/scripts/cxmanage +++ b/scripts/cxmanage @@ -34,6 +34,7 @@ """Command line tool for managing a Calxeda cluster""" import argparse +import os import pkgutil import sys @@ -64,6 +65,8 @@ def build_parser(): help='Don\'t stop at confirmation dialogue') p['parser'].add_argument('--retry', help='Retry command on multiple times', type=int, default=None, metavar='COUNT') + p['parser'].add_argument('--ipmipath', help='Path to ipmitool command', + default=None) p['verbosity'] = p['parser'].add_mutually_exclusive_group() p['verbosity'].add_argument('-v', '--verbose', action='store_true', help='Verbose output') @@ -241,6 +244,12 @@ def main(): args = parser.parse_args() validate_args(args) + if args.ipmipath: + if os.path.isdir(args.ipmipath): + args.ipmipath = args.ipmipath.rstrip('/') + '/ipmitool' + print args.ipmipath + os.environ['IPMITOOL_PATH'] = args.ipmipath + verbosity = 1 if args.verbose: verbosity = 2 |