make use of remote=True flag

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-09 14:30:53 +02:00
parent c1ad93bccc
commit 20aafe62f5

View file

@ -168,10 +168,6 @@ class Cdist:
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
self.exit_error("Command failed: " + " ".join(*newargs)) self.exit_error("Command failed: " + " ".join(*newargs))
# def remote_run_or_fail(self, *args, **kargs):
# """Run something on the remote side and fail is something breaks"""
# self.run_or_fail(newargs, **kargs)
def remove_remote_dir(self, destination): def remove_remote_dir(self, destination):
self.run_or_fail(["rm", "-rf", destination], remote=True) self.run_or_fail(["rm", "-rf", destination], remote=True)
@ -280,7 +276,7 @@ class Cdist:
# Only continue, if there is at least the directory # Only continue, if there is at least the directory
if os.path.isdir(src): if os.path.isdir(src):
# Ensure that the path exists # Ensure that the path exists
self.remote_run_or_fail(["mkdir", "-p", remote_base]) self.run_or_fail(["mkdir", "-p", remote_base], remote=True)
self.transfer_dir(src, dst) self.transfer_dir(src, dst)
@ -306,7 +302,7 @@ class Cdist:
cmd.append("__explorer=" + REMOTE_GLOBAL_EXPLORER_DIR) cmd.append("__explorer=" + REMOTE_GLOBAL_EXPLORER_DIR)
cmd.append(self.remote_global_explorer_path(explorer)) cmd.append(self.remote_global_explorer_path(explorer))
self.remote_run_or_fail(cmd, stdout=output_fd) self.run_or_fail(cmd, stdout=output_fd, remote=True)
output_fd.close() output_fd.close()
def run_type_explorer(self, cdist_object): def run_type_explorer(self, cdist_object):
@ -332,7 +328,7 @@ class Cdist:
output = os.path.join(self.type_explorer_output_dir(cdist_object), explorer) output = os.path.join(self.type_explorer_output_dir(cdist_object), explorer)
output_fd = open(output, mode='w') output_fd = open(output, mode='w')
self.remote_run_or_fail(remote_cmd, stdout=output_fd) self.run_or_fail(remote_cmd, stdout=output_fd, remote=True)
output_fd.close() output_fd.close()