aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rumba/executors/ssh.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/rumba/executors/ssh.py b/rumba/executors/ssh.py
index c47358f..6876204 100644
--- a/rumba/executors/ssh.py
+++ b/rumba/executors/ssh.py
@@ -36,18 +36,13 @@ class SSHExecutor(Executor):
self.use_proxy = use_proxy
def execute_command(self, node, command, as_root=False, time_out=3):
+ return self.execute_commands(node, [command], as_root, time_out)
+
+ def execute_commands(self, node, commands, as_root=False, time_out=3):
if as_root:
if node.ssh_config.username != 'root':
- command = "sudo %s" % command
-
- if self.use_proxy:
- return execute_proxy_command(self, node.ssh_config, command,
- time_out)
- else:
- return execute_command(self.testbed, node.ssh_config, command,
- time_out)
+ commands = list(map(lambda c: "sudo %s" % (c,), commands))
- def execute_commands(self, node, commands, as_root=False, time_out=3):
if self.use_proxy:
return execute_proxy_commands(self, node.ssh_config, commands,
time_out)
@@ -55,7 +50,7 @@ class SSHExecutor(Executor):
return execute_commands(self.testbed, node.ssh_config, commands,
time_out)
- def fetch_file(self, node, path, destination, sudo):
+ def fetch_file(self, node, path, destination, sudo=False):
copy_file_from_testbed(self.testbed, node.ssh_config, path,
destination, sudo)