Example #1
0
 def createLibvirtNetwork(self,
                          network,
                          bridged=True,
                          iface=None,
                          skipBackup=False):
     netXml = libvirt.createNetworkDef(network, bridged, iface)
     if not skipBackup:
         self._networkBackup(network)
     libvirt.createNetwork(netXml)
Example #2
0
File: ifcfg.py Project: nirs/vdsm
    def restoreAtomicNetworkBackup(self):
        logging.info("Rolling back logical networks configuration " "(restoring atomic logical networks backup)")
        for network, content in six.iteritems(self._networksBackups):
            # 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:
                libvirt.removeNetwork(network)
            except libvirtError as e:
                if e.get_error_code() == VIR_ERR_NO_NETWORK:
                    pass

            if content:
                libvirt.createNetwork(content)

            logging.info("Restored %s", network)
Example #3
0
    def restoreAtomicNetworkBackup(self):
        logging.info("Rolling back logical networks configuration "
                     "(restoring atomic logical networks backup)")
        for network, content in six.iteritems(self._networksBackups):
            # 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:
                libvirt.removeNetwork(network)
            except libvirtError as e:
                if e.get_error_code() == VIR_ERR_NO_NETWORK:
                    pass

            if content:
                libvirt.createNetwork(content)

            logging.info('Restored %s', network)
Example #4
0
 def createLibvirtNetwork(self, network, bridged=True, iface=None):
     netXml = libvirt.createNetworkDef(network, bridged, iface)
     libvirt.createNetwork(netXml)
Example #5
0
File: ifcfg.py Project: nirs/vdsm
 def createLibvirtNetwork(self, network, bridged=True, iface=None, skipBackup=False):
     netXml = libvirt.createNetworkDef(network, bridged, iface)
     if not skipBackup:
         self._networkBackup(network)
     libvirt.createNetwork(netXml)
def create_libvirt_nets(libvirt_create):
    for net_xml in six.itervalues(libvirt_create):
        libvirt.createNetwork(net_xml)
def create_libvirt_nets(libvirt_create):
    for net_xml in six.itervalues(libvirt_create):
        libvirt.createNetwork(net_xml)