X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FRouting.py;h=7795e3ffcc54aed3af63b4119b705d9eb20e7094;hp=b22516a7c430086a38aab2d0ff0d62611627b19f;hb=799c246c1783b534df0ce7731c9078463be33bdd;hpb=cdf3213528f5f560d8d8b92c642f655cef706745 diff --git a/resources/libraries/python/Routing.py b/resources/libraries/python/Routing.py index b22516a7c4..7795e3ffcc 100644 --- a/resources/libraries/python/Routing.py +++ b/resources/libraries/python/Routing.py @@ -29,17 +29,16 @@ class Routing(object): :param prefix_len: Route destination network prefix length. :param gateway: Route gateway address. :param interface: Route interface. - :type node: str + :type node: dict :type network: str :type prefix_len: int :type gateway: str :type interface: str """ sw_if_index = Topology.get_interface_sw_index(node, interface) - vat = VatTerminal(node) - vat.vat_terminal_exec_cmd_from_template('add_route.vat', - network=network, - prefix_length=prefix_len, - gateway=gateway, - sw_if_index=sw_if_index) - vat.vat_terminal_close() + with VatTerminal(node) as vat: + vat.vat_terminal_exec_cmd_from_template('add_route.vat', + network=network, + prefix_length=prefix_len, + gateway=gateway, + sw_if_index=sw_if_index)