diff --git a/cdist/exec/local.py b/cdist/exec/local.py index 575950c1..eec79399 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -254,8 +254,8 @@ class Local(object): output = None if do_save_output: - util.log_std_fd(self.log, stderr, 'Local stderr') - util.log_std_fd(self.log, stdout, 'Local stdout') + util.log_std_fd(self.log, command, stderr, 'Local stderr') + util.log_std_fd(self.log, command, stdout, 'Local stdout') return output except subprocess.CalledProcessError as e: diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py index 2331d3b2..8fcd0981 100644 --- a/cdist/exec/remote.py +++ b/cdist/exec/remote.py @@ -335,8 +335,8 @@ class Remote(object): stderr=stderr) output = None - util.log_std_fd(self.log, stderr, 'Remote stderr') - util.log_std_fd(self.log, stdout, 'Remote stdout') + util.log_std_fd(self.log, command, stderr, 'Remote stderr') + util.log_std_fd(self.log, command, stdout, 'Remote stdout') return output except subprocess.CalledProcessError as e: diff --git a/cdist/exec/util.py b/cdist/exec/util.py index 3d484013..2f2aa38c 100644 --- a/cdist/exec/util.py +++ b/cdist/exec/util.py @@ -169,8 +169,8 @@ def get_std_fd(base_path, name): return stdfd -def log_std_fd(log, stdfd, prefix): +def log_std_fd(log, command, stdfd, prefix): if stdfd is not None and stdfd != subprocess.DEVNULL: stdfd.seek(0, 0) - log.trace("{}: {}".format( - prefix, stdfd.read().decode())) + log.trace("Command: {}; {}: {}".format( + command, prefix, stdfd.read().decode()))