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