From c9f05f83213ead543dff368d3d427a528fc17d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 22 Jul 2011 13:24:55 +0200 Subject: [PATCH] Bug #741: Ruby OCA VM::save_as now returns the new image ID in case of success --- src/oca/ruby/OpenNebula/VirtualMachine.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/oca/ruby/OpenNebula/VirtualMachine.rb b/src/oca/ruby/OpenNebula/VirtualMachine.rb index c2292bc6a4..75e0aeaae5 100644 --- a/src/oca/ruby/OpenNebula/VirtualMachine.rb +++ b/src/oca/ruby/OpenNebula/VirtualMachine.rb @@ -213,14 +213,16 @@ module OpenNebula # Set the specified vm's disk to be saved in a new image # when the VirtualMachine shutdowns # - # +disk_id+ ID of the disk to be saved + # @param disk_id [Integer] ID of the disk to be saved + # @param image_name [String] Name for the new image where the + # disk will be saved # - # +image_name+ Name for the new image where the disk will be saved + # @return [Integer, OpenNebula::Error] the new Image ID in case of + # success, error otherwise def save_as(disk_id, image_name) return Error.new('ID not defined') if !@pe_id rc = @client.call(VM_METHODS[:savedisk], @pe_id, disk_id, image_name) - rc = nil if !OpenNebula.is_error?(rc) return rc end