summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-12-17 16:24:28 -0600
committerGeorge Kraft <george.kraft@calxeda.com>2013-12-17 16:24:28 -0600
commitbe6ef367ed81142da03b51c73e46769f941b8b70 (patch)
treecd1c0b6d743a72e30562e5a7db85ea343a530e61
parent2eeacb7adea68096b691b7004d31124ef36fd4f1 (diff)
downloadpyipmi-be6ef367ed81142da03b51c73e46769f941b8b70.tar.gz
CXMAN-281: Use lan_print channel argument more carefully
I don't really understand why, but apparently in the default case where we return the ipmitool args as ['lan', 'print', ''], it ends up trying to read from channel 0, which is invalid. Instead, we need to carefully return ['lan', 'print'] in the case where there's no channel specified.
-rw-r--r--pyipmi/bmc.py2
-rw-r--r--pyipmi/commands/lan.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py
index e9ef830..f1c26d4 100644
--- a/pyipmi/bmc.py
+++ b/pyipmi/bmc.py
@@ -357,7 +357,7 @@ class BMC(object):
def fru_show(self, filename):
return self.handle.fru_show(filename=filename)
- def lan_print(self, channel=''):
+ def lan_print(self, channel=None):
return self.handle.lan_print(channel=channel)
def lan_set(self, channel, command, param):
diff --git a/pyipmi/commands/lan.py b/pyipmi/commands/lan.py
index 4316700..213313e 100644
--- a/pyipmi/commands/lan.py
+++ b/pyipmi/commands/lan.py
@@ -96,8 +96,10 @@ class LANPrintCommand(Command, ResponseParserMixIn):
@property
def ipmitool_args(self):
- channel = self._params.get('channel', '')
- return ["lan", "print", channel]
+ if self._params["channel"] != None:
+ return ["lan", "print", self._params["channel"]]
+ else:
+ return ["lan", "print"]
class LANSetCommand(Command, ResponseParserMixIn):