1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-27 13:57:23 +03:00

vCenter Resource pools fixed, securing ds browsing (#2142)

This commit is contained in:
Sergio Semedi Barranco 2018-05-31 15:16:42 +02:00 committed by Tino Vázquez
parent d8e579d5a3
commit a00f82f778
2 changed files with 4 additions and 1 deletions

View File

@ -572,7 +572,9 @@ class Datastore < Storage
# Remove [datastore] from file path
folderpath = ""
size = result.folderPath.size
if result.folderPath[-1] != "]"
result.folderPath[size] = '/' if result.folderPath[-1] != '/'
folderpath = result.folderPath.sub(/^\[#{ds_name}\] /, "")
end

View File

@ -1253,7 +1253,8 @@ class VirtualMachine < Template
#Get ref for req_rp
rp_list = cluster.get_resource_pool_list
req_rp_ref = rp_list.select { |rp| rp[:name].downcase == req_rp }.first[:ref] rescue nil
req_rp_ref = rp_list.select { |rp| rp[:name].downcase == req_rp.downcase }.first[:ref] rescue nil
if vi_client.rp_confined?
if req_rp_ref && req_rp_ref != vi_client.rp._ref