Beispiel #1
0
def ovs_vsctl_del_pbridge(bridge, iface):
    """
    This function deletes the OVS bridge and assigns the bridge IP address
    back to the iface.
    """
    (ip_addr, mask) = util.interface_get_ip(bridge)
    util.interface_assign_ip(iface, ip_addr, mask)
    util.move_routes(bridge, iface)
    return ovs_vsctl_del_bridge(bridge)
Beispiel #2
0
def ovs_vsctl_del_pbridge(bridge, iface):
    """
    This function deletes the OVS bridge and assigns the bridge IP address
    back to the iface.
    """
    (ip_addr, mask) = util.interface_get_ip(bridge)
    util.interface_assign_ip(iface, ip_addr, mask)
    util.move_routes(bridge, iface)
    return ovs_vsctl_del_bridge(bridge)
Beispiel #3
0
    def xmlrpc_create_test_bridge(self, bridge, iface):
        """
        This function creates a physical bridge from iface. It moves the
        IP configuration from the physical interface to the bridge.
        """
        ret = vswitch.ovs_vsctl_add_bridge(bridge)
        if ret == 0:
            self.pbridges.add((bridge, iface))
            util.interface_up(bridge)
            (ip_addr, mask) = util.interface_get_ip(iface)
            util.interface_assign_ip(bridge, ip_addr, mask)
            util.move_routes(iface, bridge)
            util.interface_assign_ip(iface, "0.0.0.0", "255.255.255.255")
            ret = vswitch.ovs_vsctl_add_port_to_bridge(bridge, iface)
            if ret == 0:
                self.ports.add(iface)
            else:
                util.interface_assign_ip(iface, ip_addr, mask)
                util.move_routes(bridge, iface)
                vswitch.ovs_vsctl_del_bridge(bridge)

        return ret
Beispiel #4
0
    def xmlrpc_create_test_bridge(self, bridge, iface):
        """
        This function creates a physical bridge from iface. It moves the
        IP configuration from the physical interface to the bridge.
        """
        ret = vswitch.ovs_vsctl_add_bridge(bridge)
        if ret == 0:
            self.pbridges.add((bridge, iface))
            util.interface_up(bridge)
            (ip_addr, mask) = util.interface_get_ip(iface)
            util.interface_assign_ip(bridge, ip_addr, mask)
            util.move_routes(iface, bridge)
            util.interface_assign_ip(iface, "0.0.0.0", "255.255.255.255")
            ret = vswitch.ovs_vsctl_add_port_to_bridge(bridge, iface)
            if ret == 0:
                self.ports.add(iface)
            else:
                util.interface_assign_ip(iface, ip_addr, mask)
                util.move_routes(bridge, iface)
                vswitch.ovs_vsctl_del_bridge(bridge)

        return ret