virtManager: connection: Clean up some inconsistent API

This commit is contained in:
Cole Robinson 2013-07-06 17:24:51 -04:00
parent 3692e98ba0
commit 125cbc4541
2 changed files with 12 additions and 12 deletions

View File

@ -91,9 +91,9 @@ class vmmConnection(vmmGObject):
self._caps = None
self._caps_xml = None
self.network_capable = None
self._network_capable = None
self._storage_capable = None
self.interface_capable = None
self._interface_capable = None
self._nodedev_capable = None
self._xml_flags = {}
@ -422,24 +422,24 @@ class vmmConnection(vmmGObject):
return self._storage_capable
def is_network_capable(self):
if self.network_capable is None:
self.network_capable = self.check_conn_support(
if self._network_capable is None:
self._network_capable = self.check_conn_support(
self._backend.SUPPORT_CONN_NETWORK)
if self.network_capable is False:
if self._network_capable is False:
logging.debug("Connection doesn't seem to support network "
"APIs. Skipping all network polling.")
return self.network_capable
return self._network_capable
def is_interface_capable(self):
if self.interface_capable is None:
self.interface_capable = self.check_conn_support(
if self._interface_capable is None:
self._interface_capable = self.check_conn_support(
self._backend.SUPPORT_CONN_INTERFACE)
if self.interface_capable is False:
if self._interface_capable is False:
logging.debug("Connection doesn't seem to support interface "
"APIs. Skipping all interface polling.")
return self.interface_capable
return self._interface_capable
def is_nodedev_capable(self):
if self._nodedev_capable is None:

View File

@ -400,7 +400,7 @@ class vmmHost(vmmGObjectUI):
self.repopulate_interfaces()
return
if not self.conn.network_capable:
if not self.conn.is_network_capable():
self.set_net_error_page(
_("Libvirt connection does not support virtual network "
"management."))
@ -409,7 +409,7 @@ class vmmHost(vmmGObjectUI):
self.set_storage_error_page(
_("Libvirt connection does not support storage management."))
if not self.conn.interface_capable:
if not self.conn.is_interface_capable():
self.set_interface_error_page(
_("Libvirt connection does not support interface management."))