From ea810dfdda21502cae887df44264fdc73284bc88 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 6 Feb 2014 09:53:42 -0500 Subject: [PATCH] Fix session reuse stall for async usage Previously, calling code had to manually force an event loop iteration after making an asynchronous session creation request. Address that by making a non blocking iteration request happen automatically. Change-Id: I64f814401cb5ac397ac9ca4a1ae1d434976a2b01 --- pyghmi/ipmi/private/session.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 69dac31c..43c59def 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -318,6 +318,9 @@ 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