From 53c61d42ad659fc6d0f156317c26a3ae34bde071 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 9 Feb 2012 19:12:49 +0100 Subject: [PATCH] remove useless if env: Signed-off-by: Nico Schottelius --- lib/cdist/exec/remote.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/cdist/exec/remote.py b/lib/cdist/exec/remote.py index b46235a8..69dc5dda 100644 --- a/lib/cdist/exec/remote.py +++ b/lib/cdist/exec/remote.py @@ -146,18 +146,17 @@ class Remote(object): os_environ = os.environ.copy() os_environ['__target_host'] = self.target_host + self.log.debug("Remote run script: %s", command) + # can't pass environment to remote side, so prepend command with # variable declarations if env: + self.log.debug("Remote run script env: %s", env) command.extend(["%s=%s" % item for item in env.items()]) command.extend(["/bin/sh", "-e"]) command.append(script) - self.log.debug("Remote run script: %s", command) - if env: - self.log.debug("Remote run script env: %s", env) - try: if return_output: return subprocess.check_output(command, env=os_environ).decode()