diff options
Diffstat (limited to 'rumba/ssh_support.py')
-rw-r--r-- | rumba/ssh_support.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py index b1492e7..a9dff28 100644 --- a/rumba/ssh_support.py +++ b/rumba/ssh_support.py @@ -336,8 +336,10 @@ def copy_files_from_testbed(testbed, ssh_config, paths, destination = destination + '/' if sudo: - execute_command(testbed, ssh_config, - 'sudo chmod a+rw %s' % (" ".join(paths))) + cmd = 'chmod a+rw %s' % (" ".join(paths)) + if ssh_config.username != 'root': + cmd = "sudo %s" % command + execute_command(testbed, ssh_config, cmd) if ssh_config.client is None: client, proxy_client = ssh_connect(ssh_config.hostname, ssh_config.port, @@ -436,4 +438,4 @@ def aptitude_install(testbed, node, packages): "while ! " + sudo("apt-get update") + "; do sleep 1; done", "while ! " + sudo(package_install) + "; do sleep 1; done"] - execute_proxy_commands(testbed, node.ssh_config, cmds, time_out=None)
\ No newline at end of file + execute_proxy_commands(testbed, node.ssh_config, cmds, time_out=None) |