vmpooler/lib
Thomas Linkin 3119f2c0e1 Improve cluster lookup
Without this commit, cluster lookup was done by traversing the first
level below a given datacenter and comparing the names of the objects
present there. Though uncommon, entities at this level may be folders
that contain the sought after cluster. To make matters worse, a non
cluster entity may have the exact same name as the cluster being looked
up. Matching is performed by comparing only entity name and thus a
folder entity may be mistakenly returned if it matches the name provided
for lookup. Traversal into the folder entity is impossible. There is no
error checking or helpful output to determine the issue.

This commit changes the method by which cluster lookup is performed. It
assumes that, as before, the cluster name will be provided as a string
and it will be looked up by that string. However the string can be a
relative entity path as well used to traverse a folder entity. The new
lookup uses the #traverse() method from the datacenter entity to find
the cluster entity. There is also some simple return type checking to
tell if what we found in the traversal is a
`RbVmomi::VIM::ClusterComputeResource` object. If not, a basic
indication of the problem is raised to the user.
2019-03-08 15:27:50 -05:00
..
vmpooler Improve cluster lookup 2019-03-08 15:27:50 -05:00
vmpooler.rb (POOLER-138) Support multiple pools per alias 2019-02-01 09:05:23 -08:00