From 5c7ce4b804d844f75bd29ce351c9b0fa19117610 Mon Sep 17 00:00:00 2001 From: Tasos Papaioannou Date: Wed, 10 Apr 2024 15:16:16 -0400 Subject: [PATCH] Fix ssh command encoding --- 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 8d258500b2..d276cd741f 100644 --- a/robottelo/cli/base.py +++ b/robottelo/cli/base.py @@ -200,7 +200,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 a2568f5a58..e6d6de2dd7 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,