1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

B #5409: return the object in find_by_ref

(cherry picked from commit 8be52177034a63f918e5117bf44f09cd2048f943)
This commit is contained in:
Jaime Melis 2017-09-27 14:51:53 +02:00
parent daa4ad9386
commit c32d5de8c5

View File

@ -59,6 +59,7 @@ class VIHelper
pool.each_element(Proc.new do |e|
ref = e[attribute]
hash[ref] = {
opennebula_object: e,
opennebula_managed: e["TEMPLATE/OPENNEBULA_MANAGED"],
tvcenter_instance_id: e["TEMPLATE/VCENTER_INSTANCE_ID"],
uvcenter_instance_id: e["USER_TEMPLATE/VCENTER_INSTANCE_ID"]
@ -78,7 +79,7 @@ class VIHelper
if e && (!e[:opennebula_managed] || e[:opennebula_managed] != "NO") &&
(e[:tvcenter_instance_id] == vcenter_uuid ||
e[:uvcenter_instance_id] == vcenter_uuid)
return e
return e[:opennebula_object]
end
return nil