From 56c1c013bd0d632256efa4cb6b0224bf9c608afa Mon Sep 17 00:00:00 2001 From: Jan Gelety Date: Thu, 20 Jun 2019 19:49:35 +0200 Subject: FIX: IPUtil after vpp api changes + do not log all ip_route_add_del api calls to PAPI history in case of scale tests + fix for SRv6 proxy tests + support of more complex structures in api calls/replies in PapiExecutor + update of vpp stable build to version 19.08-rc0~487-gb98dbb1 Change-Id: I9972e126b68ce1cb57f781e3d90ea9b3914de69e Signed-off-by: Jan Gelety --- resources/tools/papi/vpp_papi_provider.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'resources/tools') diff --git a/resources/tools/papi/vpp_papi_provider.py b/resources/tools/papi/vpp_papi_provider.py index 1136be52dd..676f5491dd 100755 --- a/resources/tools/papi/vpp_papi_provider.py +++ b/resources/tools/papi/vpp_papi_provider.py @@ -92,11 +92,17 @@ def _convert_reply(api_r): unwanted_fields = ['count', 'index', 'context'] def process_value(val): + """Process value. + + :param val: Value to be processed. + :type val: object + :returns: Processed value. + :rtype: dict or str or int + """ if isinstance(val, dict): - val_dict = dict() for val_k, val_v in val.iteritems(): - val_dict[str(val_k)] = process_value(val_v) - return val_dict + val[str(val_k)] = process_value(val_v) + return val elif isinstance(val, list): for idx, val_l in enumerate(val): val[idx] = process_value(val_l) @@ -140,14 +146,20 @@ def process_json_request(args): reply = list() def process_value(val): + """Process value. + + :param val: Value to be processed. + :type val: object + :returns: Processed value. + :rtype: dict or str or int + """ if isinstance(val, dict): - val_dict = dict() for val_k, val_v in val.iteritems(): - val_dict[str(val_k)] = process_value(val_v) - return val_dict + val[str(val_k)] = process_value(val_v) + return val elif isinstance(val, list): - for idx, item in enumerate(val): - val[idx] = process_value(item) + for idx, val_l in enumerate(val): + val[idx] = process_value(val_l) return val elif isinstance(val, unicode): return binascii.unhexlify(val) -- cgit 1.2.3-korg