From aa9891d6c154c3644078ff84b225d2c54c46f7bc Mon Sep 17 00:00:00 2001 From: Jake Callahan Date: Tue, 11 Jun 2024 02:52:04 -0400 Subject: [PATCH] [6.14.z] Cherry-pick: Fix ssh command usage (#14703) (#15388) Fix ssh command usage (#14703) Co-authored-by: Tasos Papaioannou --- robottelo/cli/base.py | 2 +- tests/robottelo/test_cli.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/robottelo/cli/base.py b/robottelo/cli/base.py index c30231a4ea1..e7162da396e 100644 --- a/robottelo/cli/base.py +++ b/robottelo/cli/base.py @@ -201,7 +201,7 @@ def execute( command, ) response = ssh.command( - cmd.encode('utf-8'), + cmd, hostname=hostname or cls.hostname or settings.server.hostname, output_format=output_format, timeout=timeout, diff --git a/tests/robottelo/test_cli.py b/tests/robottelo/test_cli.py index a2568f5a584..e6d6de2dd7b 100644 --- a/tests/robottelo/test_cli.py +++ b/tests/robottelo/test_cli.py @@ -258,7 +258,7 @@ def test_execute_with_raw_response(self, settings, command): response = Base.execute('some_cmd', return_raw_response=True) ssh_cmd = 'LANG=en_US hammer -v -u admin -p password some_cmd' command.assert_called_once_with( - ssh_cmd.encode('utf-8'), + ssh_cmd, hostname=mock.ANY, output_format=None, timeout=None, @@ -277,7 +277,7 @@ def test_execute_with_performance(self, settings, command, handle_resp): response = Base.execute('some_cmd', hostname=None, output_format='json') ssh_cmd = 'LANG=en_US time -p hammer -v -u admin -p password --output=json some_cmd' command.assert_called_once_with( - ssh_cmd.encode('utf-8'), + ssh_cmd, hostname=mock.ANY, output_format='json', timeout=None,