From befbe7088412ca7cf1565fa09904b2d0bc75a79a Mon Sep 17 00:00:00 2001 From: Tasos Papaioannou Date: Thu, 11 Apr 2024 17:01:07 -0400 Subject: [PATCH] Fix ssh command usage (#14703) --- 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,