1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

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

(cherry picked from commit fffcc62d0a36cc8a2c85b9f91e2a080dda11a309)
This commit is contained in:
Tino Vazquez 2015-11-18 18:29:35 +01:00
parent 4557db3d93
commit b5be1631d9

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(