summaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-03-01 13:33:39 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-03 10:17:18 +0000
commit30787378f49714319e75437b347b7027a949700d (patch)
tree61c87bae97df779a3e010a82ee6678837dc77bb5 /src/tools/vppapigen
parent258fefd92fc2f451f7f0248c85542b0ee40c7302 (diff)
VPPAPIGEN: Improve output module finding for out-of-tree builds.
Change-Id: I3b646d84586dd61018f71cbf21c971c97fda75c1 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/tools/vppapigen')
-rwxr-xr-xsrc/tools/vppapigen/vppapigen.py14
1 files changed, 12 insertions, 2 deletions
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: