X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FNATUtil.py;h=a9f760768e115226979986063c1618b6cbb098bf;hp=841bd2e6836ab771f63d9944610c6dab55cd51f0;hb=HEAD;hpb=1daa6fdc0bae284dee1b61f34534e59b60b7526a diff --git a/resources/libraries/python/NATUtil.py b/resources/libraries/python/NATUtil.py index 841bd2e683..e5f530ab46 100644 --- a/resources/libraries/python/NATUtil.py +++ b/resources/libraries/python/NATUtil.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -63,9 +63,8 @@ class NATUtil: @staticmethod def enable_nat44_ed_plugin( - node, inside_vrf=0, outside_vrf=0, sessions=0, session_memory=0, - mode=u"" - ): + node, inside_vrf=0, outside_vrf=0, sessions=0, session_memory=0, + mode=u""): """Enable NAT44 plugin. :param node: DUT node. @@ -183,10 +182,9 @@ class NATUtil: """Delete and re-add the NAT range setting.""" with PapiSocketExecutor(node) as papi_exec: args_in[u"is_add"] = False - papi_exec.add(cmd, **args_in) + papi_exec.add(cmd, **args_in).get_reply(err_msg) args_in[u"is_add"] = True - papi_exec.add(cmd, **args_in) - papi_exec.get_replies(err_msg) + papi_exec.add(cmd, **args_in).get_reply(err_msg) return resetter @@ -428,10 +426,9 @@ class NATUtil: """Delete and re-add the deterministic NAT mapping.""" with PapiSocketExecutor(node) as papi_exec: args_in[u"is_add"] = False - papi_exec.add(cmd, **args_in) + papi_exec.add(cmd, **args_in).get_reply(err_msg) args_in[u"is_add"] = True - papi_exec.add(cmd, **args_in) - papi_exec.get_replies(err_msg) + papi_exec.add(cmd, **args_in).get_reply(err_msg) return resetter