2
0
mirror of https://opendev.org/x/pyghmi synced 2025-02-20 12:30:48 +00:00

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
This commit is contained in:
Jarrod Johnson 2014-02-06 10:04:54 -05:00
parent ea810dfdda
commit 6e58eae301
3 changed files with 6 additions and 3 deletions

View File

@ -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,

View File

@ -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

View File

@ -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