-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2021 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
from resources.libraries.python.PapiExecutor import PapiSocketExecutor
-class DhcpProxy(object):
+class DhcpProxy:
"""DHCP Proxy utilities."""
@staticmethod
: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'])
+ cmd = u"dhcp_proxy_dump"
+ args = dict(is_ip6=1 if ip_version == u"ipv6" else 0)
+ err_msg = f"Failed to get DHCP proxy dump on host {node[u'host']}"
with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd, **args).get_details(err_msg)