Bug #4124: Add comments for resource pool code and minor refactor

This commit is contained in:
Tino Vazquez committed 2015-11-18 18:29:35 +01:00
1 parent b0571e6c2b
commit fffcc62d0a
1 file changed
+13 -1
+13 -1
View File
@@ -160,6 +160,9 @@ class VIClient
########################################################################
# The associated resource pool for this connection
# @return [ResourcePool] an array of resource pools including the default
#  resource pool. If the connection is confined to a particular
#  resource pool, then return just that one
########################################################################
def resource_pool
rp_name = @one_host["TEMPLATE/VCENTER_RESOURCE_POOL"]
@@ -173,6 +176,15 @@ class VIClient
end
end
########################################################################
# Get the default resource pool of the connection. Only valid if
# the connection is not confined in a resource pool
# @return ResourcePool the default resource pool
########################################################################
def default_resource_pool
@cluster.resourcePool
end
########################################################################
# Searches the desired ResourcePool of the DataCenter for the current
# connection. Returns a RbVmomi::VIM::ResourcePool or the default pool
@@ -1421,7 +1433,7 @@ private
if connection.rp_confined?
rp = connection.cluster.resource_pool.first
else
rp = connection.cluster.resourcePool
rp = connection.cluster.default_resource_pool
end
relocate_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(