From 0c7af219548bfba220ba06abe32354bc596eb380 Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Wed, 10 Apr 2024 07:37:35 -0400 Subject: [PATCH] [6.14.z] Fix Capsule.install when used w/o kwargs (#14715) --- robottelo/hosts.py | 19 ++----------------- tests/foreman/api/test_capsule.py | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/robottelo/hosts.py b/robottelo/hosts.py index b51eecc15b..e98f398cc5 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1611,7 +1611,8 @@ def install(self, installer_obj=None, cmd_args=None, cmd_kwargs=None): """General purpose installer""" if not installer_obj: command_opts = {'scenario': self.__class__.__name__.lower()} - command_opts.update(cmd_kwargs) + if cmd_kwargs: + command_opts.update(cmd_kwargs) installer_obj = InstallerCommand(*cmd_args, **command_opts) return self.execute(installer_obj.get_command(), timeout=0) @@ -1710,22 +1711,6 @@ def set_rex_script_mode_provider(self, mode='ssh'): if result.status != 0: raise SatelliteHostError(f'Failed to enable pull provider: {result.stdout}') - def run_installer_arg(self, *args, timeout='20m'): - """Run an installer argument on capsule""" - installer_args = list(args) - installer_command = InstallerCommand( - installer_args=installer_args, - ) - result = self.execute( - installer_command.get_command(), - timeout=timeout, - ) - if result.status != 0: - raise SatelliteHostError( - f'Failed to execute with arguments: {installer_args} and,' - f' the stderr is {result.stderr}' - ) - def set_mqtt_resend_interval(self, value): """Set the time interval in seconds at which the notification should be re-sent to the mqtt host until the job is picked up or cancelled""" diff --git a/tests/foreman/api/test_capsule.py b/tests/foreman/api/test_capsule.py index 86aaa08992..48dd6d4b75 100644 --- a/tests/foreman/api/test_capsule.py +++ b/tests/foreman/api/test_capsule.py @@ -46,7 +46,7 @@ def test_positive_update_capsule(request, pytestconfig, target_sat, module_capsu # refresh features features = capsule.refresh() - module_capsule_configured.run_installer_arg('enable-foreman-proxy-plugin-openscap') + module_capsule_configured.install(cmd_args=['enable-foreman-proxy-plugin-openscap']) features_new = capsule.refresh() assert len(features_new["features"]) == len(features["features"]) + 1 assert 'Openscap' in [feature["name"] for feature in features_new["features"]]