@@ -687,14 +687,10 @@ def test_hostgroup_synced_content_inheritance(
687687 cv .publish ()
688688 cv = cv .read ()
689689
690- # Get content view environment ID
691- cv_env = module_target_sat .api .ContentViewEnvironment ()
692- cv_env_id = [
693- env ['id' ]
694- for env in cv_env .list_content_view_environments ()['results' ]
695- if env ['name' ] == f'Library/{ cv .name } '
696- and env ['organization' ]['id' ] == function_sca_manifest_org .id
697- ]
690+ # Get the Library lifecycle environment for the organization
691+ library_lce = module_target_sat .api .LifecycleEnvironment (
692+ organization = function_sca_manifest_org
693+ ).search (query = {'search' : 'name=Library' })[0 ]
698694
699695 # Get content source, architecture, and operating system objects for hostgroup creation
700696 content_source = module_target_sat .api .SmartProxy ().search (
@@ -720,7 +716,8 @@ def test_hostgroup_synced_content_inheritance(
720716 parent_hostgroup = module_target_sat .api .HostGroup (
721717 architecture = arch ,
722718 content_source = content_source ,
723- content_view_environment_id = cv_env_id [0 ],
719+ content_view = cv ,
720+ lifecycle_environment = library_lce ,
724721 kickstart_repository = repos_dict ['Old BaseOS' ],
725722 location = [function_location ],
726723 organization = [function_sca_manifest_org ],
0 commit comments