From 5454ab855ef9a2ab3b61d69dc1e7b98d4d0b6310 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 9 May 2014 15:58:46 -0400 Subject: [PATCH] Fix unregister_keepalive when no keepalives registered If no keepalives are registered, return cleanly from an attempt to unregister rather than raise an exception. Change-Id: I0064714af4ba8f1b62f9061dc0dc481116c871fe --- pyghmi/ipmi/private/session.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 184be97f..e3df0d13 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -958,6 +958,8 @@ class Session(object): return regid def unregister_keepalive(self, regid): + if self._customkeepalives is None: + return try: del self._customkeepalives[regid] except KeyError: