lago-project / lago

Ad-hoc virtual testing environment framework
http://lago.readthedocs.org
GNU General Public License v2.0
47 stars 39 forks source link

Use openssh for interactive 'lago shell' instead of paramiko #818

Open didib opened 3 years ago

didib commented 3 years ago

IMO we should use /usr/bin/ssh - OpenSSH - at least for interactive shells - instead of paramiko, at least for these two reasons:

[1]

[ *** ] (2 oError occured, aborting Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/lago/ssh.py", line 279, in drain_ssh_channel stdout.write(out) TypeError: write() argument must be str, not bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/lago/cmd.py", line 987, in main cli_plugins[args.verb].do_run(args) File "/usr/lib/python3.6/site-packages/lago/plugins/cli.py", line 186, in do_run self._do_run(vars(args)) File "/usr/lib/python3.6/site-packages/lago/utils.py", line 584, in wrapper return func(*args, *kwargs) File "/usr/lib/python3.6/site-packages/lago/utils.py", line 595, in wrapper return func(args, prefix=prefix, kwargs) File "/usr/lib/python3.6/site-packages/lago/cmd.py", line 480, in do_shell result = host.interactive_ssh(['bash']) File "/usr/lib/python3.6/site-packages/lago/plugins/vm.py", line 106, in wrapper return func(self, *args, *kwargs) File "/usr/lib/python3.6/site-packages/lago/plugins/vm.py", line 720, in interactive_ssh password=self._spec.get('ssh-password'), File "/usr/lib/python3.6/site-packages/lago/ssh.py", line 205, in interactive_ssh return interactive_ssh_channel(channel, ' '.join(command)) File "/usr/lib/python3.6/site-packages/lago/ssh.py", line 314, in interactive_ssh_channel return utils.CommandStatus(drain_ssh_channel(chan, stdin)) File "/usr/lib/python3.6/site-packages/lago/ssh.py", line 281, in drain_ssh_channel stdout.write(out.decode('utf-8')) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 31: unexpected end of data