Don't show error if user cancelled polkit auth

Requires recent libvirt patch to help us differentiate the error.
This commit is contained in:
Cole Robinson 2012-01-27 16:00:04 -05:00
parent 2e297ab70c
commit 8a92690a55
1 changed files with 8 additions and 1 deletions

View File

@ -1167,6 +1167,12 @@ class vmmConnection(vmmGObject):
self.state = self.STATE_DISCONNECTED
if (libexc and
(libexc.get_error_code() ==
getattr(libvirt, "VIR_ERR_AUTH_CANCELLED", None))):
logging.debug("User cancelled auth, not raising any error.")
break
if (libexc and
libexc.get_error_code() == libvirt.VIR_ERR_AUTH_FAILED and
"GSSAPI Error" in libexc.get_error_message() and
@ -1201,7 +1207,8 @@ class vmmConnection(vmmGObject):
self.vms.keys())
if self.state == self.STATE_DISCONNECTED:
self.idle_emit("connect-error", self.connectError)
if self.connectError:
self.idle_emit("connect-error", self.connectError)
self.connectError = None