aboutsummaryrefslogtreecommitdiff
path: root/rumba/ssh_support.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-04-13 14:21:54 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-04-13 14:21:54 +0200
commitbf71393b1c57741d061eee8b1f27f41daebf236f (patch)
tree5c63ab4fac4921672a08ccb4c1e7dda1568775c5 /rumba/ssh_support.py
parenta2b315d257e595af10cf55abdcf026c7c0954020 (diff)
downloadrumba-bf71393b1c57741d061eee8b1f27f41daebf236f.tar.gz
rumba-bf71393b1c57741d061eee8b1f27f41daebf236f.zip
rumba: ssh_support: Fix return of stdout
Stdout was not being returned properly after a recent commit. This fixes it.
Diffstat (limited to 'rumba/ssh_support.py')
-rw-r--r--rumba/ssh_support.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py
index c9ae687..c6615c3 100644
--- a/rumba/ssh_support.py
+++ b/rumba/ssh_support.py
@@ -33,6 +33,7 @@ def _print_stream(stream):
o_array = o.split('\\n')
for oi in o_array:
print(oi)
+ return o_array
def execute_commands(testbed, ssh_config, commands, time_out=3):
'''
@@ -58,9 +59,10 @@ def execute_commands(testbed, ssh_config, commands, time_out=3):
envars = '. /etc/profile;'
command = envars + ' ' + command
stdin, stdout, stderr = ssh_client.exec_command(command)
- _print_stream(stdout)
+ o_array = _print_stream(stdout)
_print_stream(stderr)
ssh_client.close()
+ return o_array
except Exception as e:
print(str(e))
@@ -80,7 +82,9 @@ def execute_command(testbed, ssh_config, command, time_out=3):
@return: stdout resulting from the command
'''
- return execute_commands(testbed, ssh_config, [command], time_out)
+ o_array = execute_commands(testbed, ssh_config, [command], time_out)
+ if o_array != None:
+ return o_array[0]
def copy_file_to_testbed(testbed, ssh_config, text, file_name):
'''