1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-13 12:58:17 +03:00

F #4913: Add wait_for_completion to vCenter rm_directory that may cause vcenter 6.5 crashes

This commit is contained in:
mcabrerizo 2017-06-26 12:56:45 +02:00
parent e01faaadd6
commit 8ff2e568a8
3 changed files with 5 additions and 5 deletions

View File

@ -79,8 +79,8 @@ begin
ds.delete_file(img_src)
end
vcenter_version = vi_client.vim.serviceContent.about.apiVersion
ds.rm_directory(img_dir) if ds.dir_empty?(img_dir) && vcenter_version != "6.5"
#vcenter_version = vi_client.vim.serviceContent.about.apiVersion
ds.rm_directory(img_dir) if ds.dir_empty?(img_dir) #&& vcenter_version != "6.5"
rescue Exception => e
if !e.message.start_with?('FileNotFound')

View File

@ -119,8 +119,8 @@ if path.match(/disk\.\d+$/)
ds.delete_virtual_disk(img_path)
img_dir = File.dirname(img_path)
vcenter_version = vi_client.vim.serviceContent.about.apiVersion
ds.rm_directory(img_dir) if ds.dir_empty?(img_dir) && vcenter_version != "6.5"
#vcenter_version = vi_client.vim.serviceContent.about.apiVersion
ds.rm_directory(img_dir) if ds.dir_empty?(img_dir) #&& vcenter_version != "6.5"
rescue Exception => e
if !e.message.start_with?('FileNotFound')

View File

@ -364,7 +364,7 @@ class Datastore < Storage
:datacenter => get_dc.item
}
get_fm.DeleteDatastoreFile_Task(rm_directory_params)
get_fm.DeleteDatastoreFile_Task(rm_directory_params).wait_for_completion
end
def dir_empty?(path)