From c13a5a375da845af9684a4997dd19d15932efb67 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 22 Aug 2013 15:57:03 -0400 Subject: [PATCH] Add support for non standard ports. It is possible and in some cases required for an implementation to deviate from the IPMI standard port of 623. This enables the library to actually support that case. Change-Id: I62e322410924153cebde9827d7ba0d0583aa1d83 --- pyghmi/ipmi/command.py | 4 +++- pyghmi/ipmi/console.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 7dee099e..a8051b9c 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -71,7 +71,7 @@ class Command(object): :param kg: Optional parameter to use if BMC has a particular Kg configured """ - def __init__(self, bmc, userid, password, onlogon=None, kg=None): + def __init__(self, bmc, userid, password, port=623, onlogon=None, kg=None): # TODO(jbjohnso): accept tuples and lists of each parameter for mass # operations without pushing the async complexities up the stack self.onlogon = onlogon @@ -81,11 +81,13 @@ class Command(object): userid=userid, password=password, onlogon=self.logged, + port=port, kg=kg) else: self.ipmi_session = session.Session(bmc=bmc, userid=userid, password=password, + port=port, kg=kg) def logged(self, response): diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index 3f76ed25..3ae15549 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -42,7 +42,7 @@ class Console(object): #TODO(jbjohnso): still need an exit and a data callin function def __init__(self, bmc, userid, password, - iohandler=None, + iohandler=None, port=623, force=False, kg=None): if type(iohandler) == tuple: # two file handles self.console_in = iohandler[0] @@ -71,6 +71,7 @@ class Console(object): self.ipmi_session = session.Session(bmc=bmc, userid=userid, password=password, + port=port, kg=kg, onlogon=self._got_session)