From 7882b4a3ac11b0866819f92b50e9231d11166aed Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 26 Sep 2011 16:03:53 +0200 Subject: [PATCH] only print env, if existent Signed-off-by: Nico Schottelius --- lib/cdist/exec.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cdist/exec.py b/lib/cdist/exec.py index f95ba941..b0f98b56 100644 --- a/lib/cdist/exec.py +++ b/lib/cdist/exec.py @@ -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: