connection: Fix some code that trips up pylint

This commit is contained in:
Cole Robinson 2011-08-30 14:50:29 -04:00
parent cbbc8044bf
commit 66f879e19d

View File

@ -1140,23 +1140,29 @@ class vmmConnection(vmmGObject):
logging.debug("Background 'open connection' thread is running")
while True:
libexc = None
exc = None
tb = None
try:
self.vmm = self._try_open()
except libvirt.libvirtError, libexc:
tb = "".join(traceback.format_exc())
except Exception, exc:
tb = "".join(traceback.format_exc())
if libexc:
exc = libexc
if not exc:
self.state = self.STATE_ACTIVE
break
self.state = self.STATE_DISCONNECTED
if (type(exc) == libvirt.libvirtError and
exc.get_error_code() == libvirt.VIR_ERR_AUTH_FAILED and
"GSSAPI Error" in exc.get_error_message() and
"No credentials cache found" in exc.get_error_message()):
if (libexc and
libexc.get_error_code() == libvirt.VIR_ERR_AUTH_FAILED and
"GSSAPI Error" in libexc.get_error_message() and
"No credentials cache found" in libexc.get_error_message()):
if self._acquire_tgt():
continue