From 1300483467d131fa9b1fd71ef1146358d2bf5823 Mon Sep 17 00:00:00 2001 From: vsedmik <46570670+vsedmik@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:45:15 +0100 Subject: [PATCH] Fix AK for errata CLI tests (#16742) --- robottelo/host_helpers/cli_factory.py | 14 ++++++++++++-- tests/foreman/cli/test_errata.py | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index 47a5d602720..7f9c73cb86f 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -666,7 +666,12 @@ def setup_org_for_a_custom_repo(self, options=None): # Associate activation key with CV just to be sure try: self._satellite.cli.ActivationKey.update( - {'content-view-id': cv_id, 'id': activationkey_id, 'organization-id': org_id} + { + 'id': activationkey_id, + 'organization-id': org_id, + 'content-view-id': cv_id, + 'lifecycle-environment-id': env_id, + } ) except CLIReturnCodeError as err: raise CLIFactoryError( @@ -818,7 +823,12 @@ def _setup_org_for_a_rh_repo(self, options=None, force=False): # Associate activation key with CV just to be sure try: self._satellite.cli.ActivationKey.update( - {'id': activationkey_id, 'organization-id': org_id, 'content-view-id': cv_id} + { + 'id': activationkey_id, + 'organization-id': org_id, + 'content-view-id': cv_id, + 'lifecycle-environment-id': env_id, + } ) except CLIReturnCodeError as err: raise CLIFactoryError( diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index 73705a31063..f161ab5355b 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -1162,6 +1162,7 @@ def new_module_ak( ): new_module_ak = module_target_sat.api.ActivationKey( environment=module_lce_library, + content_view=module_sca_manifest_org.default_content_view, organization=module_sca_manifest_org, ).create() # Ensure tools repo is enabled in the activation key