Example #1
0
    def _create_bridge(self, name, xml):
        conn = self.conn.get()

        # check if name exists
        if name in netinfo.all_interfaces():
            raise InvalidOperation("KCHNET0010E", {"iface": name})

        # create bridge through libvirt
        try:
            bridge = conn.interfaceDefineXML(xml)
            bridge.create()
        except libvirt.libvirtError as e:
            raise OperationFailed("KCHNET0025E", {"name": name, "err": e.get_error_message()})
Example #2
0
    def _create_bridge(self, name, xml):
        conn = self.conn.get()

        # check if name exists
        if name in netinfo.all_interfaces():
            raise InvalidOperation("KCHNET0010E", {'iface': name})

        # create bridge through libvirt
        try:
            bridge = conn.interfaceDefineXML(xml)
            bridge.create()
        except libvirt.libvirtError as e:
            raise OperationFailed("KCHNET0025E", {'name': name,
                                  'err': e.get_error_message()})