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

Minor modificatio to ImageRepository rm function

This commit is contained in:
Ruben S. Montero 2010-10-18 23:05:58 +02:00
parent 39bb0f21fa
commit 75d01c2584

View File

@ -217,23 +217,21 @@ module OpenNebula
#
########################################################################
def remove(source)
if File.exists?(source)
if !File.exists?(source)
return nil
end
begin
if File.directory?(source)
begin
FileUtils.rmdir(source)
rescue Exception => e
return OpenNebula::Error.new(e.message)
end
FileUtils.rmdir(source)
else
begin
FileUtils.rm(source)
rescue Exception => e
return OpenNebula::Error.new(e.message)
end
FileUtils.rm(source)
end
rescue Exception => e
return OpenNebula::Error.new(e.message)
end
return nil
end
end
end
end