From 3ed2ef8494cc77ab3fd5f2ffb847224d0f817040 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 14 Aug 2013 14:48:19 -0400 Subject: [PATCH] Fix raw handling by ipmictl.py The test harness was incorrectly throwing string values at the library. Correct that by explicitly converting from hex string to int. Additionally, command.py was failing to pass data through. Change-Id: Iceda4c3b4a382992d445f90dfbc19f6c75b528df --- ipmictl.py | 5 +++-- pyghmi/ipmi/command.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ipmictl.py b/ipmictl.py index 1e7103ab..b5df209d 100755 --- a/ipmictl.py +++ b/ipmictl.py @@ -58,8 +58,9 @@ def docommand(result, ipmisession): else: print ipmisession.get_bootdev() elif cmmand == 'raw': - print ipmisession.raw_command(netfn=args[0], - command=args[1], data=args[2:]) + print ipmisession.raw_command(netfn=int(args[0]), + command=int(args[1]), + data=map(lambda x: int(x, 16), args[2:])) bmcs = string.split(bmc, ",") for bmc in bmcs: diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index e239cfa8..7dee099e 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -256,7 +256,8 @@ class Command(object): :param data: Command data as a tuple or list :returns: dict -- The response from IPMI device """ - return self.ipmi_session.raw_command(netfn=netfn, command=command) + return self.ipmi_session.raw_command(netfn=netfn, command=command, + data=data) def get_power(self): """Get current power state of the managed system