Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemorency committed Jul 18, 2024
1 parent b80a8ac commit 712c07d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/module_utils/vmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def get_vm_using_params(
)
vms = [_vm] if _vm else None
else:
vms = self.get_objs_by_name_or_moid([vim.VirtualMachine], _search_value)
vms = self.get_objs_by_name_or_moid([vim.VirtualMachine], _search_value, return_all=True)

if vms and _search_type == 'name' and self.params.get(name_match_param):
if self.params.get(name_match_param) == 'first':
Expand All @@ -352,7 +352,7 @@ def get_folder_by_name(self, folder_name, fail_on_missing=False):
Returns:
list(folder object) or None
"""
folder = self.get_objs_by_name_or_moid([vim.Folder], folder_name)
folder = self.get_objs_by_name_or_moid([vim.Folder], folder_name, return_all=True)
if not folder and fail_on_missing:
self.module.fail_json("Unable to find folder with name %s" % folder_name)
return folder
Expand Down Expand Up @@ -384,7 +384,7 @@ def get_datastore_by_name(self, ds_name, fail_on_missing=False):
Returns:
datastore object or None
"""
ds = self.get_objs_by_name_or_moid([vim.Datastore], ds_name, first_only=True)
ds = self.get_objs_by_name_or_moid([vim.Datastore], ds_name)
if not ds and fail_on_missing:
self.module.fail_json("Unable to find datastore with name %s" % ds_name)
return ds
Expand All @@ -399,7 +399,7 @@ def get_resource_pool_by_name(self, pool_name, fail_on_missing=False):
Returns:
resource pool object or None
"""
pool = self.get_objs_by_name_or_moid([vim.ResourcePool], pool_name, first_only=True)
pool = self.get_objs_by_name_or_moid([vim.ResourcePool], pool_name)
if not pool and fail_on_missing:
self.module.fail_json("Unable to find resource pool with name %s" % pool_name)
return pool

0 comments on commit 712c07d

Please sign in to comment.