Review at  https://gerrit.osmocom.org/3974

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.

Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c
---
M osmopy/osmodumpdoc.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests 
refs/changes/74/3974/1

diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py
index 0ff1f6b..247fb84 100644
--- a/osmopy/osmodumpdoc.py
+++ b/osmopy/osmodumpdoc.py
@@ -28,7 +28,7 @@
 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 @@
         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
@@ -84,7 +84,7 @@
 
     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:

-- 
To view, visit https://gerrit.osmocom.org/3974
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c
Gerrit-PatchSet: 1
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>

Reply via email to