mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
connection: Mark a few bits as private
This commit is contained in:
parent
873c22d19a
commit
d4c27baa45
@ -84,8 +84,8 @@ class vmmConnection(vmmGObject):
|
|||||||
self._uri = "xen:///"
|
self._uri = "xen:///"
|
||||||
|
|
||||||
self.state = self.STATE_DISCONNECTED
|
self.state = self.STATE_DISCONNECTED
|
||||||
self.connectThread = None
|
self._connectThread = None
|
||||||
self.connectError = None
|
self._connectError = None
|
||||||
self._backend = virtinst.VirtualConnection(self._uri)
|
self._backend = virtinst.VirtualConnection(self._uri)
|
||||||
self._closing = False
|
self._closing = False
|
||||||
|
|
||||||
@ -1011,13 +1011,13 @@ class vmmConnection(vmmGObject):
|
|||||||
|
|
||||||
def _cleanup(self):
|
def _cleanup(self):
|
||||||
self.close()
|
self.close()
|
||||||
self.connectError = None
|
self._connectError = None
|
||||||
|
|
||||||
def open(self, sync=False):
|
def open(self, sync=False):
|
||||||
if self.state != self.STATE_DISCONNECTED:
|
if self.state != self.STATE_DISCONNECTED:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.connectError = None
|
self._connectError = None
|
||||||
self._change_state(self.STATE_CONNECTING)
|
self._change_state(self.STATE_CONNECTING)
|
||||||
|
|
||||||
if sync:
|
if sync:
|
||||||
@ -1027,17 +1027,17 @@ class vmmConnection(vmmGObject):
|
|||||||
else:
|
else:
|
||||||
logging.debug("Scheduling background open thread for " +
|
logging.debug("Scheduling background open thread for " +
|
||||||
self.get_uri())
|
self.get_uri())
|
||||||
self.connectThread = threading.Thread(target=self._open_thread,
|
self._connectThread = threading.Thread(target=self._open_thread,
|
||||||
name="Connect %s" % self.get_uri())
|
name="Connect %s" % self.get_uri())
|
||||||
self.connectThread.setDaemon(True)
|
self._connectThread.setDaemon(True)
|
||||||
self.connectThread.start()
|
self._connectThread.start()
|
||||||
|
|
||||||
def _do_creds_password(self, creds):
|
def _do_creds_password(self, creds):
|
||||||
try:
|
try:
|
||||||
return connectauth.creds_dialog(creds)
|
return connectauth.creds_dialog(creds)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
# Detailed error message, in English so it can be Googled.
|
# Detailed error message, in English so it can be Googled.
|
||||||
self.connectError = (
|
self._connectError = (
|
||||||
"Failed to get credentials for '%s':\n%s\n%s" %
|
"Failed to get credentials for '%s':\n%s\n%s" %
|
||||||
(self.get_uri(), str(e), "".join(traceback.format_exc())))
|
(self.get_uri(), str(e), "".join(traceback.format_exc())))
|
||||||
return -1
|
return -1
|
||||||
@ -1089,14 +1089,14 @@ class vmmConnection(vmmGObject):
|
|||||||
if connectauth.acquire_tgt():
|
if connectauth.acquire_tgt():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.connectError = (str(exc), tb, warnconsole)
|
self._connectError = (str(exc), tb, warnconsole)
|
||||||
break
|
break
|
||||||
|
|
||||||
# We want to kill off this thread asap, so schedule an
|
# We want to kill off this thread asap, so schedule an
|
||||||
# idle event to inform the UI of result
|
# idle event to inform the UI of result
|
||||||
logging.debug("Background open thread complete, scheduling notify")
|
logging.debug("Background open thread complete, scheduling notify")
|
||||||
self.idle_add(self._open_notify)
|
self.idle_add(self._open_notify)
|
||||||
self.connectThread = None
|
self._connectThread = None
|
||||||
|
|
||||||
def _open_notify(self):
|
def _open_notify(self):
|
||||||
logging.debug("Notifying open result")
|
logging.debug("Notifying open result")
|
||||||
@ -1119,9 +1119,9 @@ class vmmConnection(vmmGObject):
|
|||||||
force=True)
|
force=True)
|
||||||
|
|
||||||
if self.state == self.STATE_DISCONNECTED:
|
if self.state == self.STATE_DISCONNECTED:
|
||||||
if self.connectError:
|
if self._connectError:
|
||||||
self.idle_emit("connect-error", *self.connectError)
|
self.idle_emit("connect-error", *self._connectError)
|
||||||
self.connectError = None
|
self._connectError = None
|
||||||
|
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
|
Loading…
Reference in New Issue
Block a user