mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Add a vmware_datastore_facts module (#30815)
Fix a bunch of things mentioned in the review. Delete commented code from module. Add fix for vcsim not returning uncommitted. Add integration test. Add changes suggested
This commit is contained in:
@@ -144,6 +144,21 @@ def find_datacenter_by_name(content, datacenter_name):
|
||||
return None
|
||||
|
||||
|
||||
def get_parent_datacenter(obj):
|
||||
""" Walk the parent tree to find the objects datacenter """
|
||||
if isinstance(obj, vim.Datacenter):
|
||||
return obj
|
||||
datacenter = None
|
||||
while True:
|
||||
if not hasattr(obj, 'parent'):
|
||||
break
|
||||
obj = obj.parent
|
||||
if isinstance(obj, vim.Datacenter):
|
||||
datacenter = obj
|
||||
break
|
||||
return datacenter
|
||||
|
||||
|
||||
def find_datastore_by_name(content, datastore_name):
|
||||
|
||||
datastores = get_all_objs(content, [vim.Datastore])
|
||||
|
||||
Reference in New Issue
Block a user