only print env, if existent

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-26 16:03:53 +02:00
parent 4906f604f0
commit 7882b4a3ac
1 changed files with 4 additions and 1 deletions

View File

@ -38,7 +38,10 @@ def shell_run_or_debug_fail(script, *args, **kargs):
del kargs["remote_prefix"]
log.debug("Shell exec cmd: %s", args)
log.debug("Shell exec env: %s", kargs['env'])
if 'env' in kargs:
log.debug("Shell exec env: %s", kargs['env'])
try:
subprocess.check_call(*args, **kargs)
except subprocess.CalledProcessError: