Fix for bug in detach disk

(cherry picked from commit f8b58adf37)
This commit is contained in:
Tino Vazquez committed 2016-07-21 16:52:42 +02:00
1 parent f626bbe357
commit 347435ecc4
2 files changed
+2 -1

No files matched your search

+1 -1
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
@@ -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?