コード例 #1
0
ファイル: lxc.py プロジェクト: 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.")
コード例 #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.")
コード例 #3
0
 def _network_delete(self):
     try:
         network.delete(self._network)
     except Exception:
         self.logger.exception("Unable to delete network.")
コード例 #4
0
ファイル: network_test.py プロジェクト: xx-zhang/see
 def test_delete(self):
     """NETWORK Network is destroyed on delete()."""
     net = mock.Mock()
     network.delete(net)
     self.assertTrue(net.destroy.called)
コード例 #5
0
ファイル: network_test.py プロジェクト: noxdafox/see
 def test_delete(self):
     """NETWORK Network is destroyed on delete()."""
     net = mock.Mock()
     network.delete(net)
     self.assertTrue(net.destroy.called)
コード例 #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.")
コード例 #7
0
ファイル: qemu.py プロジェクト: MahaKoala/see
 def _network_delete(self):
     try:
         network.delete(self._network)
     except Exception:
         self.logger.exception("Unable to delete network.")
コード例 #8
0
ファイル: qemu.py プロジェクト: 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.")