X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fhoneycomb%2FNAT.py;h=759b8010266a0d0ee0d33eb3b31fe1799125d532;hb=68a4959b2f4b23ecf1c894c10a365fbdbb3dbf6a;hp=1fb066d10cd8a6647920833165768836ecac5b85;hpb=954e51613f8dbd4f2fa4a7c2cf7c066176bee963;p=csit.git diff --git a/resources/libraries/python/honeycomb/NAT.py b/resources/libraries/python/honeycomb/NAT.py index 1fb066d10c..759b801026 100644 --- a/resources/libraries/python/honeycomb/NAT.py +++ b/resources/libraries/python/honeycomb/NAT.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2018 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: @@ -41,7 +41,7 @@ class NATKeywords(object): :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the status code in response to PUT is not - OK or ACCEPTED. + OK or ACCEPTED. """ if data: @@ -67,7 +67,7 @@ class NATKeywords(object): :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the operation fails or the response - is not as expected. + is not as expected. """ status_code, resp = HcUtil.get_honeycomb_data(node, "oper_nat") @@ -75,10 +75,10 @@ class NATKeywords(object): if status_code != HTTPCodes.OK: raise HoneycombError("Could not retrieve NAT operational data.") - if "nat-state" not in resp.keys(): + if "nat" not in resp.keys(): raise HoneycombError( - "Unexpected format, response does not contain nat-state.") - return resp['nat-state'] + "Unexpected format, response does not contain nat container.") + return resp['nat'] @staticmethod def configure_nat_entries(node, data, instance=0, entry=1): @@ -98,7 +98,7 @@ class NATKeywords(object): return NATKeywords._set_nat_properties( node, - '/nat-instances/nat-instance/{0}/' + '/instances/instance/{0}/' 'mapping-table/mapping-entry/{1}/'.format(instance, entry), data)