From 35fb5ce4b0062b5d92cf2cff7ab29f7bc2423aeb Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 16 Jul 2013 10:59:45 -0400 Subject: [PATCH] Add raw command to ipmictl Enable raw command for example utility Change-Id: I44d71b5c4cab57e9465fabb2482a78baa505895d --- ipmictl.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ipmictl.py b/ipmictl.py index 7d1aea21..ffa33d08 100755 --- a/ipmictl.py +++ b/ipmictl.py @@ -33,17 +33,22 @@ if (len(sys.argv) < 3): bmc = sys.argv[1] userid = sys.argv[2] command = sys.argv[3] -arg = None -if len(sys.argv) == 5: - arg = sys.argv[4] +args = None +if len(sys.argv) >= 5: + args = sys.argv[4:] ipmicmd = Command(bmc=bmc, userid=userid, password=password) if command == 'power': - if arg: - print ipmicmd.set_power(arg, wait=True) + if args[0]: + print ipmicmd.set_power(args[0], wait=True) else: print ipmicmd.get_power() elif command == 'bootdev': - if arg: - print ipmicmd.set_bootdev(arg) + if args[0]: + print ipmicmd.set_bootdev(args[0]) else: print ipmicmd.get_bootdev() +elif command == 'raw': + netfn = args[0] + command = args[1] + data = args[2:] + print ipmicmd.raw_command(netfn=netfn, command=command, data=data)