2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-21 16:39:32 +00:00

Await IPMI session challenge callbacks

The IPMI 1.5 session-challenge callback returned coroutine objects from error reporting and session activation instead of expressing an asynchronous callback contract directly. That made completion depend on the dispatch path noticing and awaiting the returned object.

Make the callback asynchronous and explicitly await both onlogon() and _activate_session(), ensuring failure notification and activation finish before callback dispatch continues.
This commit is contained in:
Markus Hilger
2026-07-13 16:18:15 +02:00
parent 670a11666d
commit dc906b9cd0
@@ -1043,15 +1043,16 @@ class Session(object):
elif self.ipmiversion == 2.0:
await self._open_rmcpplus_request()
def _got_session_challenge(self, response):
async def _got_session_challenge(self, response):
errstr = get_ipmi_error(response,
suffix=" while getting session challenge")
if errstr:
return self.onlogon({'error': errstr})
await self.onlogon({'error': errstr})
return
data = response['data']
self.sessionid = struct.unpack("<I", bytes(data[0:4]))[0]
self.authtype = 2
return self._activate_session(data[4:])
await self._activate_session(data[4:])
# NOTE(jbjohnso):
# This sends the activate session payload. We pick '1' as the requested