Skip to content

Commit

Permalink
Make module_ak an empty entity
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik committed Oct 21, 2024
1 parent ae59020 commit 7ffce0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pytest_fixtures/component/activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ def function_activation_key(function_sca_manifest_org, target_sat):


@pytest.fixture(scope='module')
def module_ak(module_lce, module_org, module_target_sat):
def module_ak(module_lce, module_cv, module_org, module_target_sat):
return module_target_sat.api.ActivationKey(
environment=module_lce,
organization=module_org,
).create()

Expand Down
8 changes: 5 additions & 3 deletions robottelo/host_helpers/api_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,19 +608,21 @@ def register_host_and_needed_setup(
# updated entities after promoting
entities = {k: v.read() for k, v in entities.items()}

updates = []
if ( # assign env to ak if not present
entities['ActivationKey'].environment is None
or entities['ActivationKey'].environment.id != entities['LifecycleEnvironment'].id
):
entities['ActivationKey'].environment = entities['LifecycleEnvironment']
entities['ActivationKey'].update(['environment'])
entities = {k: v.read() for k, v in entities.items()}
updates.append('environment')
if ( # assign cv to ak if not present
entities['ActivationKey'].content_view is None
or entities['ActivationKey'].content_view.id != entities['ContentView'].id
):
entities['ActivationKey'].content_view = entities['ContentView']
entities['ActivationKey'].update(['content_view'])
updates.append('content_view')
if updates:
entities['ActivationKey'].update(updates)

entities = {k: v.read() for k, v in entities.items()}
if enable_repos:
Expand Down

0 comments on commit 7ffce0a

Please sign in to comment.