plugin_script: CWD to the script directory
This allows runnig helper scripts from the main script by just using the current directory './' path, e.g. to run helper_script from main script: ./helper_script Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
3987d03137
commit
f4a7d1c71f
1 changed files with 2 additions and 1 deletions
|
|
@ -37,7 +37,8 @@ class ScriptPlugin(base.Plugin):
|
|||
log.info("calling script '%s' with argument '%s'" % (script, argument))
|
||||
log.debug("using environment '%s'" % str(environ.items()))
|
||||
try:
|
||||
proc = Popen([script, argument], stdout=PIPE, stderr=PIPE, close_fds=True, env=environ)
|
||||
proc = Popen([script, argument], stdout=PIPE, stderr=PIPE, close_fds=True, env=environ, \
|
||||
cwd = os.path.dirname(script))
|
||||
out, err = proc.communicate()
|
||||
if proc.returncode:
|
||||
log.error("script '%s' error: %d, '%s'" % (script, proc.returncode, err[:-1]))
|
||||
|
|
|
|||
Loading…
Reference in a new issue