Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMware: vmware_datastore_facts: don't nodify dict in iter (#54869) #54870

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/ansible/modules/cloud/vmware/vmware_datastore_facts.py
Expand Up @@ -214,10 +214,12 @@ def get_all_objs(self, content, types, confine_to_datacenter=True):
if confine_to_datacenter:
if hasattr(objects, 'items'):
# resource pools come back as a dictionary
tmpobjs = objects.copy()
for k, v in objects.items():
parent_dc = get_parent_datacenter(k)
if parent_dc.name != self.dc_name:
objects.pop(k, None)
tmpobjs.pop(k, None)
objects = tmpobjs
else:
# everything else should be a list
objects = [x for x in objects if get_parent_datacenter(x).name == self.dc_name]
Expand Down