also export __target_host to check_call

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-21 15:50:19 +02:00
parent 6ec4cefe09
commit c29c419f61

View file

@ -128,7 +128,7 @@ class Remote(object):
if return_output: if return_output:
return subprocess.check_output(command, env=os_environ).decode() return subprocess.check_output(command, env=os_environ).decode()
else: else:
subprocess.check_call(command) subprocess.check_call(command, env=os_environ)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
raise cdist.Error("Command failed: " + " ".join(command)) raise cdist.Error("Command failed: " + " ".join(command))
except OSError as error: except OSError as error:
@ -164,7 +164,7 @@ class Remote(object):
if return_output: if return_output:
return subprocess.check_output(command, env=os_environ).decode() return subprocess.check_output(command, env=os_environ).decode()
else: else:
subprocess.check_call(command) subprocess.check_call(command, env=os_environ)
except subprocess.CalledProcessError as error: except subprocess.CalledProcessError as error:
script_content = self.run(["cat", script], return_output=True) script_content = self.run(["cat", script], return_output=True)
self.log.error("Code that raised the error:\n%s", script_content) self.log.error("Code that raised the error:\n%s", script_content)