From 6e58eae3016187f7732cbade4066952f0c8b520a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 6 Feb 2014 10:04:54 -0500 Subject: [PATCH] Move previous fix out to command and console console at least needed the assignment to the session to occur prior to its callback working. Move the responsibility of the mandatory loop iteration up a layer so that pyghmi won't break, but calling code won't have to worry about this either. Change-Id: I6711acf97574581bb389259563e82e4430bb3f98 --- pyghmi/ipmi/command.py | 3 +++ pyghmi/ipmi/console.py | 3 +++ pyghmi/ipmi/private/session.py | 3 --- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index da431c06..ef8d3f55 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -87,6 +87,9 @@ class Command(object): onlogon=self.logged, port=port, kg=kg) + # induce one iteration of the loop, now that we would be + # prepared for it in theory + session.Session.wait_for_rsp(0) else: self.ipmi_session = session.Session(bmc=bmc, userid=userid, diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index 6c6c694f..92be4751 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -61,6 +61,9 @@ class Console(object): port=port, kg=kg, onlogon=self._got_session) + # induce one iteration of the loop, now that we would be + # prepared for it in theory + session.Session.wait_for_rsp(0) def _got_session(self, response): """Private function to navigate SOL payload activation diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 43c59def..69dac31c 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -318,9 +318,6 @@ class Session(object): self.logonwaiters.append(onlogon) else: self.iterwaiters.append(onlogon) - # Induce an immediate iteration of the event loop - # so that these handlers get the information they are hoping for - Session.wait_for_rsp(0) return self.maxtimeout = 3 # be aggressive about giving up on initial packet self.incommand = False