Change working directory for quickrun
authorSimo Sorce <simo@redhat.com>
Fri, 5 Dec 2014 20:49:14 +0000 (15:49 -0500)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Fri, 5 Dec 2014 20:55:45 +0000 (15:55 -0500)
Set the current working directory to the provided one, so if realtive
paths are used by plugins they within the quickrun working area.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
quickrun.py

index ac22f6b..c39e06a 100755 (executable)
@@ -92,8 +92,9 @@ if __name__ == '__main__':
 
     penv = dict()
     penv.update(os.environ)
-    penv['PYTHONPATH'] = './'
+    penv['PYTHONPATH'] = os.getcwd()
 
+    exe = os.path.join(os.getcwd(), 'ipsilon/ipsilon')
 
     if args['cleanup']:
         shutil.rmtree(args['workdir'])
@@ -103,5 +104,7 @@ if __name__ == '__main__':
     else:
         conf = os.path.join(args['workdir'], 'ipsilon.conf')
 
-    p = subprocess.Popen(['./ipsilon/ipsilon', conf], env=penv)
+    os.chdir(args['workdir'])
+
+    p = subprocess.Popen([exe, conf], env=penv)
     p.wait()