mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-16 17:53:08 +09:00
bug #327: "onevm saveas" saves disks not created from repository images without the -t option
This commit is contained in:
1 parent
48b0904fcf
commit
75fecc154b
1 file changed
+14
-12
+14
-12
@@ -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
|
||||
|
||||
Reference in new issue
Block a user