X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FL2Util.py;h=c0a764fa2dc537eb426d94ded162b757984fd136;hp=a89130814c3f5c4664e12154bfbceb662031b5c2;hb=799c246c1783b534df0ce7731c9078463be33bdd;hpb=cdf3213528f5f560d8d8b92c642f655cef706745 diff --git a/resources/libraries/python/L2Util.py b/resources/libraries/python/L2Util.py index a89130814c..c0a764fa2d 100644 --- a/resources/libraries/python/L2Util.py +++ b/resources/libraries/python/L2Util.py @@ -167,11 +167,10 @@ class L2Util(object): """ sw_iface1 = Topology().get_interface_sw_index(node, interface1) sw_iface2 = Topology().get_interface_sw_index(node, interface2) - vat = VatTerminal(node) - vat.vat_terminal_exec_cmd_from_template('l2_xconnect.vat', - interface1=sw_iface1, - interface2=sw_iface2) - vat.vat_terminal_exec_cmd_from_template('l2_xconnect.vat', - interface1=sw_iface2, - interface2=sw_iface1) - vat.vat_terminal_close() + with VatTerminal(node) as vat: + vat.vat_terminal_exec_cmd_from_template('l2_xconnect.vat', + interface1=sw_iface1, + interface2=sw_iface2) + vat.vat_terminal_exec_cmd_from_template('l2_xconnect.vat', + interface1=sw_iface2, + interface2=sw_iface1)