1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-22 17:57:46 +03:00

bug #327: "onevm saveas" saves disks not created from repository images without the -t option

(cherry picked from commit 75fecc154bb7c96fda78f35d3357a79e53e88d98)
This commit is contained in:
Carlos Martín 2010-08-24 16:39:13 +02:00 committed by Javi Fontan
parent c3ee819df2
commit d00fc726b0

View File

@ -705,19 +705,21 @@ when "saveas"
image_type = ops[:type]
else
image_id = vm["TEMPLATE/DISK[DISK_ID=\"#{disk_id}\"]/IMAGE_ID"]
# Get the image type
image = OpenNebula::Image.new(
OpenNebula::Image.build_xml(image_id),
get_one_client)
result = image.info
if !is_successful?(result)
puts result.message
exit -1
if (image_id != nil)
# Get the image type
image = OpenNebula::Image.new(
OpenNebula::Image.build_xml(image_id),
get_one_client)
result = image.info
if !is_successful?(result)
puts result.message
exit -1
end
image_type = image.type_str
end
image_type = image.type_str
end
# Build the template and allocate the new Image