aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2019-07-12 17:31:25 +0200
committerJan Gelety <jgelety@cisco.com>2019-07-19 17:52:13 +0000
commit13bc34ab5a07eff486a8a0d9a1cffa6cbc0b5dc5 (patch)
tree344fab9ded6d5c92d4d46691ce0ea7476ce8e2cb /resources/libraries
parent385f224625afd53e478e6508066e0c0dd5fc108a (diff)
CSIT-1471: Migrate Dhcp library from VAT to PAPI
Change-Id: Ibc9b9b736532cce31994537e632daa4d4e62459c Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/python/Dhcp.py13
1 files changed, 9 insertions, 4 deletions
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