Beispiel #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)
Beispiel #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)
Beispiel #3
0
 def removeLibvirtNetwork(self, network, skipBackup=False):
     if not skipBackup:
         self._networkBackup(network)
     libvirtCfg.removeNetwork(network)
Beispiel #4
0
 def removeLibvirtNetwork(self, network):
     libvirtCfg.removeNetwork(network)
Beispiel #5
0
 def removeLibvirtNetwork(self, network, skipBackup=False):
     if not skipBackup:
         self._networkBackup(network)
     libvirtCfg.removeNetwork(network)