From 1b5ae5d8e0fce5cae7952ca2b55038eae73b5a21 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 Oct 2015 15:56:30 -0400 Subject: [PATCH] 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 --- pyghmi/ipmi/private/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index c2ae8723..ee1b751d 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -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