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

F #5818: Fixing case where no images exist in datastore (#2227)

(cherry picked from commit 94865d2dd7ef3e3d37870644fd7c06f198e713af)
This commit is contained in:
onenhansen 2022-07-11 02:02:47 -06:00 committed by Tino Vazquez
parent ff2703084b
commit 3de71881ce

View File

@ -604,6 +604,7 @@ module OpenNebula::MarketPlaceAppExt
exported = {}
idx = 0
idy = 0
opt_name = ''
# Store IDs of created resources
images = []
@ -634,8 +635,9 @@ module OpenNebula::MarketPlaceAppExt
img_names = imgp.retrieve_elements('/IMAGE_POOL/IMAGE/NAME')
opt_name = options[:name]
t_short = "#{opt_name}-#{obj_name}-#{idx}"
if img_names.include? "#{opt_name}-#{obj_name}-#{idx}"
if !img_names.nil? && img_names.include?(t_short)
idy = 0
while img_names.include? \
"#{opt_name}_#{idy}-#{obj_name}-#{idx}"