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

F OpenNebula/one#5502: Improve container clean (#1418)

(cherry picked from commit 88d720886537ba2232eed64cd5e771088ab321fa)
This commit is contained in:
Daniel Clavijo Coca 2021-09-02 10:39:47 -05:00 committed by Ruben S. Montero
parent d87c885795
commit 9b19609540
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 3 additions and 6 deletions

View File

@ -129,10 +129,10 @@ class Container
end
# Clean bindpoint
FileUtils.rm_rf(@one.bind_folder)
FileUtils.rm_rf(@one.bind_folder) if Dir.exist?(@one.bind_folder)
# Destroy container
@client.destroy(@one.vm_name)
@client.destroy(@one.vm_name) if @client.list.include?(@one.vm_name)
end
#---------------------------------------------------------------------------

View File

@ -377,10 +377,7 @@ class Disk
break unless device.empty?
end
if device.empty?
msg = "Cannot detect block device from #{@mountpoint}"
OpenNebula.log_error(msg)
end
OpenNebula.log("No block device on #{@mountpoint}") if device.empty?
device
end