def cleanup(self): """Releases all resources.""" filesystem = None if self._domain is not None: if 'filesystem' in self.configuration: filesystem = os.path.join(self.configuration['filesystem']['source_path'], self.identifier) domain_delete(self._domain, self.logger, filesystem) if self._network is not None: try: network.delete(self._network) except Exception: self.logger.exception("Unable to delete network.") if self._hypervisor is not None: try: self._hypervisor.close() except Exception: self.logger.exception("Unable to close hypervisor connection.")
def cleanup(self): """Releases all resources.""" filesystem = None if self._domain is not None: if 'filesystem' in self.configuration: filesystem = os.path.join( self.configuration['filesystem']['source_path'], self.identifier) domain_delete(self._domain, self.logger, filesystem) if self._network is not None: try: network.delete(self._network) except Exception: self.logger.exception("Unable to delete network.") if self._hypervisor is not None: try: self._hypervisor.close() except Exception: self.logger.exception("Unable to close hypervisor connection.")
def _network_delete(self): try: network.delete(self._network) except Exception: self.logger.exception("Unable to delete network.")
def test_delete(self): """NETWORK Network is destroyed on delete().""" net = mock.Mock() network.delete(net) self.assertTrue(net.destroy.called)
def _network_delete(self): if 'network' in self.configuration: try: network.delete(self._network) except Exception: self.logger.exception("Unable to delete network.")
def _network_delete(self): if "network" in self.configuration: try: network.delete(self._network) except Exception: self.logger.exception("Unable to delete network.")