Revision bc285e20

View differences:

src/cli/oneimage
492 492
when "delete"
493 493
    check_parameters("delete", 1)
494 494
    args=expand_args(ARGV)
495
    
495

  
496 496
    args.each do |param|
497 497
        image_id=get_image_id(param)
498
    
498

  
499 499
        image=OpenNebula::Image.new_with_id(image_id, get_one_client)
500
    
501
        result=image.delete
500

  
501
        result = image.info
502

  
502 503
        if is_successful?(result)
503
            puts "Image correctly deleted"  if ops[:verbose]
504
        else
505
            break
504

  
505
            file_path = image['SOURCE']
506

  
507
            result=image.delete
508

  
509
            if is_successful?(result)
510
                FileUtils.rm(file_path) if File.exists?(file_path)
511
                puts "Image correctly deleted"  if ops[:verbose]
512
            end
506 513
        end
507 514
    end
508 515

  
509 516
else
510 517
    oneimage_opts.print_help
511 518
    exit -1
512
end   
519
end
513 520

  
514 521
if OpenNebula.is_error?(result)
515 522
    puts "Error: " + result.message

Also available in: Unified diff