Ejemplo n.º 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)
Ejemplo n.º 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)
    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.interface_up(bridge)
            util.move_routes(iface, bridge)
            util.interface_remove_ip(iface, ip_addr, mask)
            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.interface_up(iface)
                util.move_routes(bridge, iface)
                vswitch.ovs_vsctl_del_bridge(bridge)

        return ret
Ejemplo n.º 4
0
 def xmlrpc_interface_assign_ip(self, iface, ip_address, mask):
     """
     This function allows to assing ip address to the given interface.
     """
     return util.interface_assign_ip(iface, ip_address, mask)
Ejemplo n.º 5
0
 def xmlrpc_interface_assign_ip(self, iface, ip_address, mask):
     """
     This function allows to assing ip address to the given interface.
     """
     return util.interface_assign_ip(iface, ip_address, mask)