X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fpython%2Fvpp_papi%2Fvpp_papi.py;fp=src%2Fvpp-api%2Fpython%2Fvpp_papi%2Fvpp_papi.py;h=a9edfed81bef6f4f3fdefd190dda0e6d5e7f3061;hb=1588222e72d19cc769ad0fa9b60349819e2e328f;hp=e67ee192f998e77949299d99cda8dca9584dc4ef;hpb=74ceb38a193e9050038c9db9138b3559ab31767d;p=vpp.git diff --git a/src/vpp-api/python/vpp_papi/vpp_papi.py b/src/vpp-api/python/vpp_papi/vpp_papi.py index e67ee192f99..a9edfed81be 100644 --- a/src/vpp-api/python/vpp_papi/vpp_papi.py +++ b/src/vpp-api/python/vpp_papi/vpp_papi.py @@ -154,7 +154,7 @@ class VPPValueError(ValueError): class VPPApiJSONFiles: @classmethod - def find_api_dir(cls, dirs): + def find_api_dir(cls, dirs=[]): """Attempt to find the best directory in which API definition files may reside. If the value VPP_API_DIR exists in the environment then it is first on the search list. If we're inside a recognized @@ -170,6 +170,9 @@ class VPPApiJSONFiles: # in which case, plot a course to likely places in the src tree import __main__ as main + if os.getenv("VPP_API_DIR"): + dirs.append(os.getenv("VPP_API_DIR")) + if hasattr(main, "__file__"): # get the path of the calling script localdir = os.path.dirname(os.path.realpath(main.__file__))