diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-09-18 16:01:44 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-09-18 16:30:31 +0200 |
commit | 8e4806c5f20f082c911f5a95d88c5fdd2c26d58b (patch) | |
tree | e92592db29c8e0fc95bced0f8159da3c0ba19e5c | |
parent | f41db1e337d66c9b904a553d63e3babf22223249 (diff) |
osmodumpdoc: fix finding cfg when not calling from source tree
When the binary has not been built in the source tree, it was impossible to
call osmodumpdoc.py despite the -p <config-path> option. Look for config files
in that config-path.
Make sure a relative config-path is adjusted when changing to the workdir.
Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c
-rw-r--r-- | osmopy/osmodumpdoc.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index 0ff1f6b..ce9fec4 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -28,7 +28,7 @@ def dump_doc(name, port, filename): Returns the number of apps configs could not be dumped for.""" -def dump_configs(apps, configs): +def dump_configs(apps, configs, confpath): failures = 0 successes = 0 @@ -41,7 +41,7 @@ def dump_configs(apps, configs): appname = app[3] print "Starting app for %s" % appname proc = None - cmd = [app[1], "-c", configs[appname][0]] + cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) except OSError: # Probably a missing binary @@ -82,9 +82,10 @@ if __name__ == '__main__': osmoappdesc = osmoutil.importappconf_or_quit( confpath, "osmoappdesc", args.p) + confpath = os.path.relpath(confpath, workdir) os.chdir(workdir) num_fails, num_sucs = dump_configs( - osmoappdesc.apps, osmoappdesc.app_configs) + osmoappdesc.apps, osmoappdesc.app_configs, confpath) if num_fails > 0: print >> sys.stderr, "Warning: Skipped %s apps" % num_fails if 0 == num_sucs: |