Merge pull request #12724 from mtward/issue-11605

Fix: preserve_existing_hosts flag in awx.awx.group module, while adding a new host to inventory group, retains only 25 existing hosts related #11605
This commit is contained in:
Matthew Jones 2022-09-07 20:23:58 -04:00 committed by GitHub
commit cea8c16064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,7 +170,7 @@ def main():
id_list.append(sub_obj['id'])
# Preserve existing objects
if (preserve_existing_hosts and relationship == 'hosts') or (preserve_existing_children and relationship == 'children'):
preserve_existing_check = module.get_endpoint(group['related'][relationship])
preserve_existing_check = module.get_all_endpoint(group['related'][relationship])
for sub_obj in preserve_existing_check['json']['results']:
id_list.append(sub_obj['id'])
if id_list: