Skip to content

Commit

Permalink
Fix Capsule.install when used w/o kwargs (#14693)
Browse files Browse the repository at this point in the history
(cherry picked from commit d37f76c)
  • Loading branch information
lpramuk authored and web-flow committed Apr 10, 2024
1 parent bac77e7 commit ebe3a54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
19 changes: 2 additions & 17 deletions robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,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)

Expand Down Expand Up @@ -1696,22 +1697,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"""
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/api/test_capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]
Expand Down

0 comments on commit ebe3a54

Please sign in to comment.