2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 04:07:48 +00:00

Fix exception on logout

When logging out, the session is obviously not logged
after the request to logout has been processed.  If
retry is False, do not be surprised we don't have a 'lastresponse'.

Change-Id: Ia5cbdab3736148fa36ced8835bd8d9fdca1dc12d
This commit is contained in:
Jarrod Johnson 2015-10-30 15:56:30 -04:00
parent 50d6b2bce1
commit 1b5ae5d8e0

View File

@ -630,7 +630,7 @@ class Session(object):
Session.wait_for_rsp(timeout=timeout)
lastresponse = self.lastresponse
self.incommand = False
if lastresponse is None:
if retry and lastresponse is None:
raise exc.IpmiException('Session no longer connected')
return lastresponse