X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FDhcp.py;h=e69ee0bcb8c07e4ac13d7c247aab0b783782817b;hb=aafa2efa63b891e85ff13255691aae4909bc503c;hp=cd074c37028f7cf33fea9fe10b074a576b5e6587;hpb=87c41b8df8b3c50a90e9d3d740ac629028109dc1;p=csit.git diff --git a/resources/libraries/python/Dhcp.py b/resources/libraries/python/Dhcp.py index cd074c3702..e69ee0bcb8 100644 --- a/resources/libraries/python/Dhcp.py +++ b/resources/libraries/python/Dhcp.py @@ -14,7 +14,7 @@ """DHCP utilities for VPP.""" -from resources.libraries.python.VatExecutor import VatExecutor +from resources.libraries.python.PapiExecutor import PapiSocketExecutor class DhcpProxy(object): @@ -31,7 +31,12 @@ class DhcpProxy(object): :returns: DHCP relay data. :rtype: list """ + cmd = 'dhcp_proxy_dump' + args = dict(is_ip6=1 if ip_version == 'ipv6' else 0) + err_msg = 'Failed to get DHCP proxy dump on host {host}'.format( + host=node['host']) - return VatExecutor.cmd_from_template( - node, "dhcp_proxy_dump.vat", - ipv6="ipv6" if ip_version == "ipv6" else "") + with PapiSocketExecutor(node) as papi_exec: + details = papi_exec.add(cmd, **args).get_details(err_msg) + + return details