mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-25 02:50:08 +03:00
bug #292: 'oneimage delete' now removes also the file from the repository.
This commit is contained in:
parent
63ae9d1eea
commit
bc285e20a7
@ -492,24 +492,31 @@ when "show"
|
||||
when "delete"
|
||||
check_parameters("delete", 1)
|
||||
args=expand_args(ARGV)
|
||||
|
||||
|
||||
args.each do |param|
|
||||
image_id=get_image_id(param)
|
||||
|
||||
|
||||
image=OpenNebula::Image.new_with_id(image_id, get_one_client)
|
||||
|
||||
result=image.delete
|
||||
|
||||
result = image.info
|
||||
|
||||
if is_successful?(result)
|
||||
puts "Image correctly deleted" if ops[:verbose]
|
||||
else
|
||||
break
|
||||
|
||||
file_path = image['SOURCE']
|
||||
|
||||
result=image.delete
|
||||
|
||||
if is_successful?(result)
|
||||
FileUtils.rm(file_path) if File.exists?(file_path)
|
||||
puts "Image correctly deleted" if ops[:verbose]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
oneimage_opts.print_help
|
||||
exit -1
|
||||
end
|
||||
end
|
||||
|
||||
if OpenNebula.is_error?(result)
|
||||
puts "Error: " + result.message
|
||||
|
Loading…
x
Reference in New Issue
Block a user