Skip to content

Commit

Permalink
missing documentation and duplicate method name
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemorency committed Dec 16, 2024
1 parent c528144 commit bb1aba5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions plugins/module_utils/_vmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
"""
Expand Down

0 comments on commit bb1aba5

Please sign in to comment.