示例#1
0
    def restoreAtomicNetworkBackup(self):
        logging.info("Rolling back logical networks configuration " "(restoring atomic logical networks backup)")
        for network, content in self._networksBackups.iteritems():
            # Networks with content None should be removed.
            # Networks with real content should be recreated.
            # To avoid libvirt errors during recreation we need
            # to remove the old network first
            try:
                libvirtCfg.removeNetwork(network)
            except libvirt.libvirtError as e:
                if e.get_error_code() == libvirt.VIR_ERR_NO_NETWORK:
                    pass

            if content:
                libvirtCfg.createNetwork(content)

            logging.info("Restored %s", network)
示例#2
0
    def restoreAtomicNetworkBackup(self):
        logging.info("Rolling back logical networks configuration "
                     "(restoring atomic logical networks backup)")
        for network, content in self._networksBackups.iteritems():
            # Networks with content None should be removed.
            # Networks with real content should be recreated.
            # To avoid libvirt errors during recreation we need
            # to remove the old network first
            try:
                libvirtCfg.removeNetwork(network)
            except libvirt.libvirtError as e:
                if e.get_error_code() == libvirt.VIR_ERR_NO_NETWORK:
                    pass

            if content:
                libvirtCfg.createNetwork(content)

            logging.info('Restored %s', network)
示例#3
0
文件: ifcfg.py 项目: therealmik/vdsm
 def removeLibvirtNetwork(self, network, skipBackup=False):
     if not skipBackup:
         self._networkBackup(network)
     libvirtCfg.removeNetwork(network)
示例#4
0
 def removeLibvirtNetwork(self, network):
     libvirtCfg.removeNetwork(network)
示例#5
0
 def removeLibvirtNetwork(self, network, skipBackup=False):
     if not skipBackup:
         self._networkBackup(network)
     libvirtCfg.removeNetwork(network)