aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/VPPUtil.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2019-03-07 14:43:13 +0100
committerTibor Frank <tifrank@cisco.com>2019-03-15 08:27:30 +0000
commitc353d540f70907eac811acd19de8955a55c7eaed (patch)
tree02b29a3808853170baa63e8700c68ca042a4804f /resources/libraries/python/VPPUtil.py
parent812fb62e6d62264e5b063c4a7a627819e24af823 (diff)
PAPI: Add verification of the response
Change-Id: I86afcaeae865f0af076b8dd974386a83de07bf44 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/libraries/python/VPPUtil.py')
-rw-r--r--resources/libraries/python/VPPUtil.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py
index 1bc1b4358e..57a78fc03a 100644
--- a/resources/libraries/python/VPPUtil.py
+++ b/resources/libraries/python/VPPUtil.py
@@ -149,15 +149,15 @@ class VPPUtil(object):
"""
with PapiExecutor(node) as papi_exec:
- papi_resp = papi_exec.add('show_version').execute_should_pass()
- data = papi_resp.reply[0]['api_reply']['show_version_reply']
+ data = papi_exec.add('show_version').execute_should_pass().\
+ verify_reply()
version = ('VPP version: {ver}\n'.
format(ver=data['version'].rstrip('\0x00')))
if verbose:
version += ('Compile date: {date}\n'
- 'Compile location: {loc}\n '.
+ 'Compile location: {cl}\n '.
format(date=data['build_date'].rstrip('\0x00'),
- loc=data['build_directory'].rstrip('\0x00')))
+ cl=data['build_directory'].rstrip('\0x00')))
logger.info(version)
@staticmethod
@@ -303,7 +303,6 @@ class VPPUtil(object):
:returns: VPP thread data.
:rtype: list
"""
-
with PapiExecutor(node) as papi_exec:
- resp = papi_exec.add('show_threads').execute_should_pass()
- return resp.reply[0]['api_reply']['show_threads_reply']['thread_data']
+ return papi_exec.add('show_threads').execute_should_pass().\
+ verify_reply()["thread_data"]