From bb1aba5b26d9637e83365516802662790ed151b2 Mon Sep 17 00:00:00 2001 From: Mike Morency Date: Wed, 11 Dec 2024 09:38:22 -0500 Subject: [PATCH] missing documentation and duplicate method name --- plugins/module_utils/_vmware.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/module_utils/_vmware.py b/plugins/module_utils/_vmware.py index 0342afc6..fc747a5c 100644 --- a/plugins/module_utils/_vmware.py +++ b/plugins/module_utils/_vmware.py @@ -222,11 +222,12 @@ def get_objs_by_name_or_moid(self, vimtype, name, return_all=False, search_root_ # for backwards-compat return None - def get_dvs_portgroup_by_name_or_moid(self, identifier, fail_on_missing=False): + def get_standard_portgroup_by_name_or_moid(self, identifier, fail_on_missing=False): """ Get a portgroup from type 'STANDARD_PORTGROUP' based on name or MOID Args: identifier: The name or the ID of the portgroup + fail_on_missing: If true, an error will be thrown if no networks are found Returns: The standard portgroup object """ @@ -240,6 +241,7 @@ def get_dvs_portgroup_by_name_or_moid(self, identifier, fail_on_missing=False): Get a portgroup from type 'DISTRIBUTED_PORTGROUP' based on name or MOID Args: identifier: The name or the ID of the portgroup + fail_on_missing: If true, an error will be thrown if no networks are found Returns: The distributed portgroup object """ @@ -304,7 +306,7 @@ def get_vm_using_params( def get_folders_by_name_or_moid(self, identifier, fail_on_missing=False): """ - Get all folders with the given name. Names are not unique + Get all folders with the given name or MOID. Names are not unique in a given cluster, so multiple folder objects can be returned Args: identifier: Name or MOID of the folder to search for @@ -336,7 +338,7 @@ def get_folder_by_absolute_path(self, folder_path, fail_on_missing=False): def get_datastore_by_name_or_moid(self, identifier, fail_on_missing=False): """ - Get the datastore matching the given name. Datastore names must be unique + Get the datastore matching the given name or MOID. Datastore names must be unique in a given cluster, so only one object is returned at most. Args: identifier: Name or MOID of the datastore to search for @@ -351,7 +353,7 @@ def get_datastore_by_name_or_moid(self, identifier, fail_on_missing=False): def get_resource_pool_by_name_or_moid(self, identifier, fail_on_missing=False): """ - Get the resource pool matching the given name. Pool names must be unique + Get the resource pool matching the given name or MOID. Pool names must be unique in a given cluster, so only one object is returned at most. Args: identifier: Name or MOID of the pool to search for @@ -403,7 +405,7 @@ def get_all_vms(self, folder=None, recurse=True): def get_datacenter_by_name_or_moid(self, identifier, fail_on_missing=False): """ - Get the datacenter matching the given name. Datacenter names must be unique + Get the datacenter matching the given name or MOID. Datacenter names must be unique in a given vcenter, so only one object is returned at most. Args: identifier: Name or MOID of the datacenter to search for @@ -418,11 +420,13 @@ def get_datacenter_by_name_or_moid(self, identifier, fail_on_missing=False): def get_cluster_by_name_or_moid(self, identifier, fail_on_missing=False, datacenter=None): """ - Get the cluster matching the given name. Cluster names must be unique + Get the cluster matching the given name or MOID. Cluster names must be unique in a given vcenter, so only one object is returned at most. Args: identifier: Name or MOID of the cluster to search for fail_on_missing: If true, an error will be thrown if no clusters are found + datacenter: The datacenter object to use as a filter when searching for clusters. If + not provided then all datacenters will be examined Returns: cluster object or None """