Exemplo n.º 1
0
Arquivo: lxc.py Projeto: zdzhjx/see
    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.")
Exemplo n.º 2
0
    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.")
Exemplo n.º 3
0
 def _network_delete(self):
     try:
         network.delete(self._network)
     except Exception:
         self.logger.exception("Unable to delete network.")
Exemplo n.º 4
0
 def test_delete(self):
     """NETWORK Network is destroyed on delete()."""
     net = mock.Mock()
     network.delete(net)
     self.assertTrue(net.destroy.called)
Exemplo n.º 5
0
 def test_delete(self):
     """NETWORK Network is destroyed on delete()."""
     net = mock.Mock()
     network.delete(net)
     self.assertTrue(net.destroy.called)
Exemplo n.º 6
0
 def _network_delete(self):
     if 'network' in self.configuration:
         try:
             network.delete(self._network)
         except Exception:
             self.logger.exception("Unable to delete network.")
Exemplo n.º 7
0
 def _network_delete(self):
     try:
         network.delete(self._network)
     except Exception:
         self.logger.exception("Unable to delete network.")
Exemplo n.º 8
0
Arquivo: qemu.py Projeto: noxdafox/see
 def _network_delete(self):
     if "network" in self.configuration:
         try:
             network.delete(self._network)
         except Exception:
             self.logger.exception("Unable to delete network.")