Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions tests/foreman/api/test_hostgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,10 @@ def test_hostgroup_synced_content_inheritance(
cv.publish()
cv = cv.read()

# Get content view environment ID
cv_env = module_target_sat.api.ContentViewEnvironment()
cv_env_id = [
env['id']
for env in cv_env.list_content_view_environments()['results']
if env['name'] == f'Library/{cv.name}'
and env['organization']['id'] == function_sca_manifest_org.id
]
# Get the Library lifecycle environment for the organization
library_lce = module_target_sat.api.LifecycleEnvironment(
organization=function_sca_manifest_org
).search(query={'search': 'name=Library'})[0]

# Get content source, architecture, and operating system objects for hostgroup creation
content_source = module_target_sat.api.SmartProxy().search(
Expand All @@ -720,7 +716,8 @@ def test_hostgroup_synced_content_inheritance(
parent_hostgroup = module_target_sat.api.HostGroup(
architecture=arch,
content_source=content_source,
content_view_environment_id=cv_env_id[0],
content_view=cv,
lifecycle_environment=library_lce,
kickstart_repository=repos_dict['Old BaseOS'],
location=[function_location],
organization=[function_sca_manifest_org],
Expand Down
Loading