mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
Add find_folder method details
Specifically that the 3rd argument datacentername supports a 'nil' value, in which case the first datacenter is returned.
This commit is contained in:
parent
7077eadc65
commit
5355d1cf03
1 changed files with 6 additions and 0 deletions
|
|
@ -510,6 +510,12 @@ module Vmpooler
|
|||
available_unit_numbers.sort[0]
|
||||
end
|
||||
|
||||
# Finds the first reference to and returns the folder object for a foldername and an optional datacenter
|
||||
# Params:
|
||||
# +foldername+:: the folder to find (optionally with / in which case the foldername will be split and each element searched for)
|
||||
# +connection+:: the vsphere connection object
|
||||
# +datacentername+:: the datacenter where the folder resides, or nil to return the first datacenter found
|
||||
# returns a ManagedObjectReference for the first folder found or nil if none found
|
||||
def find_folder(foldername, connection, datacentername)
|
||||
datacenter = connection.serviceInstance.find_datacenter(datacentername)
|
||||
raise("Datacenter #{datacentername} does not exist") if datacenter.nil?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue