X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Ftools%2Fvppapigen%2Fvppapigen.py;h=a230e2290e32df3d4e8efaa87f964b625887ea1b;hb=2de1f15;hp=81f26fe44328de75bb4fb59989f3c13467ac5a1d;hpb=9d42087149a6870965896be74dc6260f72d2cac9;p=vpp.git diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py index 81f26fe4432..a230e2290e3 100755 --- a/src/tools/vppapigen/vppapigen.py +++ b/src/tools/vppapigen/vppapigen.py @@ -720,11 +720,21 @@ def main(): import imp # Default path + pluginpath = '' if not args.pluginpath: - pluginpath = os.path.dirname(os.path.realpath(__file__)) + \ - '/../share/vpp/' + cand = [] + cand.append(os.path.dirname(os.path.realpath(__file__))) + cand.append(os.path.dirname(os.path.realpath(__file__)) + \ + '/../share/vpp/') + for c in cand: + c += '/' + if os.path.isfile(c + args.output_module + '.py'): + pluginpath = c + break else: pluginpath = args.pluginpath + '/' + if pluginpath == '': + raise Exception('Output plugin not found') module_path = pluginpath + args.output_module + '.py' try: