diff options
Diffstat (limited to 'resources/libraries/python/Routing.py')
-rw-r--r-- | resources/libraries/python/Routing.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/resources/libraries/python/Routing.py b/resources/libraries/python/Routing.py index fbe7b60183..ff675f39a9 100644 --- a/resources/libraries/python/Routing.py +++ b/resources/libraries/python/Routing.py @@ -17,10 +17,12 @@ from resources.libraries.python.VatExecutor import VatTerminal from resources.libraries.python.topology import Topology from resources.libraries.python.ssh import exec_cmd_no_error + class Routing(object): """Routing utilities.""" + # pylint: disable=too-many-arguments @staticmethod def vpp_route_add(node, network, prefix_len, gateway=None, interface=None, use_sw_index=True, resolve_attempts=10, @@ -101,23 +103,23 @@ class Routing(object): where=place) @staticmethod - def add_route(node, ip, prefix, gw, namespace=None): + def add_route(node, ip_addr, prefix, gateway, namespace=None): """Add route in namespace. :param node: Node where to execute command. - :param ip: Route destination IP. + :param ip_addr: Route destination IP address. :param prefix: IP prefix. - :param namespace: Execute command in namespace. Optional - :param gw: Gateway. + :param namespace: Execute command in namespace. Optional. + :param gateway: Gateway address. :type node: dict - :type ip: str + :type ip_addr: str :type prefix: int - :type gw: str + :type gateway: str :type namespace: str """ if namespace is not None: cmd = 'ip netns exec {} ip route add {}/{} via {}'.format( - namespace, ip, prefix, gw) + namespace, ip_addr, prefix, gateway) else: - cmd = 'ip route add {}/{} via {}'.format(ip, prefix, gw) + cmd = 'ip route add {}/{} via {}'.format(ip_addr, prefix, gateway) exec_cmd_no_error(node, cmd, sudo=True) |