aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-01-22 15:31:56 +0000
committerJan Gelety <jgelety@cisco.com>2019-01-24 16:50:56 +0100
commit35ae14a1a109d357bb548e0fb8aaf941ed4a85f2 (patch)
tree160143747e202d84fe592cd2b33dac5188293a3c /resources/tools
parent552491e8bcff9745b04fbdd92609351ec9597cdc (diff)
CSIT-1407 FIX vpp install after VPP changes
Change-Id: I9148f6de75c3100f827eedec48c4c0ccb343bc54 Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/papi/vpp_papi_provider.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/resources/tools/papi/vpp_papi_provider.py b/resources/tools/papi/vpp_papi_provider.py
index 69b196843a..845cc932ca 100644
--- a/resources/tools/papi/vpp_papi_provider.py
+++ b/resources/tools/papi/vpp_papi_provider.py
@@ -60,7 +60,7 @@ if do_import:
CLIENT_NAME = 'csit_papi'
-def papi_init(vpp_json_dir='/usr/share/vpp/api/'):
+def papi_init():
"""Construct a VPP instance from VPP JSON API files.
:param vpp_json_dir: Directory containing all the JSON API files. If VPP is
@@ -71,18 +71,8 @@ def papi_init(vpp_json_dir='/usr/share/vpp/api/'):
:raises PapiJsonFileError: If no api.json file found.
:raises PapiInitError: If PAPI initialization failed.
"""
- # construct a list of all the json api files
- jsonfiles = []
- for root, dirnames, filenames in os.walk(vpp_json_dir):
- for filename in fnmatch.filter(filenames, '*.api.json'):
- jsonfiles.append(os.path.join(vpp_json_dir, filename))
- if not jsonfiles:
- raise PapiJsonFileError(
- 'No json api files found in location {dir}'.format(
- dir=vpp_json_dir))
-
try:
- vpp = VPP(jsonfiles)
+ vpp = VPP()
return vpp
except Exception as err:
raise PapiInitError('PAPI init failed:\n{exc}'.format(exc=repr(err)))
@@ -191,9 +181,8 @@ def main():
help="Directory containing all vpp json api files.")
args = parser.parse_args()
json_string = args.json_data
- vpp_json_dir = args.json_dir
- vpp = papi_init(vpp_json_dir=vpp_json_dir)
+ vpp = papi_init()
reply = list()
json_data = json.loads(json_string)