X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FNATUtil.py;fp=resources%2Flibraries%2Fpython%2FNATUtil.py;h=0f8e74666380f3c4c415238df162e53603fd9eda;hp=422feaedb80e221816e37e6c9e2abf9d8f19053f;hb=d6af9d72acaca4dff70dce1b55dcc03f73061c7b;hpb=b2ff2bb435a765c588b5ae9f8461bbf9b5064651 diff --git a/resources/libraries/python/NATUtil.py b/resources/libraries/python/NATUtil.py index 422feaedb8..0f8e746663 100644 --- a/resources/libraries/python/NATUtil.py +++ b/resources/libraries/python/NATUtil.py @@ -202,19 +202,25 @@ class NATUtil: return resetter @staticmethod - def show_nat_config(node): - """Show the NAT configuration. + def show_nat44_config(node): + """Show the NAT44 plugin running configuration. :param node: DUT node. :type node: dict """ - cmd = u"nat_show_config" - err_msg = f"Failed to get NAT configuration on host {node[u'host']}" + cmd = u"nat44_show_running_config" + err_msg = f"Failed to get NAT44 configuration on host {node[u'host']}" - with PapiSocketExecutor(node) as papi_exec: - reply = papi_exec.add(cmd).get_reply(err_msg) + try: + with PapiSocketExecutor(node) as papi_exec: + reply = papi_exec.add(cmd).get_reply(err_msg) + except AssertionError: + # Perhaps VPP is an older version + old_cmd = u"nat_show_config" + with PapiSocketExecutor(node) as papi_exec: + reply = papi_exec.add(old_cmd).get_reply(err_msg) - logger.debug(f"NAT Configuration:\n{pformat(reply)}") + logger.debug(f"NAT44 Configuration:\n{pformat(reply)}") @staticmethod def show_nat44_summary(node):