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

Fix for bug in detach disk

(cherry picked from commit f8b58adf3742a1260c145440d7ceb1df5a64d352)
This commit is contained in:
Tino Vazquez 2016-07-21 16:51:09 +02:00
parent f626bbe357
commit 347435ecc4
2 changed files with 2 additions and 1 deletions

View File

@ -62,6 +62,6 @@ begin
ds_name,
img_path)
rescue Exception => e
STDERR.puts "Error detaching image #{img_path} size. Reason: #{e.message}"
STDERR.puts "Error detaching image #{img_path}. Reason: #{e.message}"
exit -1
end

View File

@ -2650,6 +2650,7 @@ private
ds_and_img_name = "[#{ds_name}] #{img_path}"
disk = vm.config.hardware.device.select { |d| is_disk?(d) &&
d.backing.respond_to?(:fileName) &&
d.backing.fileName == ds_and_img_name }
raise "Disk #{img_path} not found." if disk.nil?