mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
Fix for SAVE_AS bug through the OCCI interface
(cherry picked from commit 9fed541625)
This commit is contained in:
1 parent
a4960cba5d
commit
271ebda488
1 file changed
+1
-14
@@ -325,20 +325,7 @@ class OCCIServer < CloudServer
|
||||
return OpenNebula::Error.new(error_msg), 400
|
||||
end
|
||||
|
||||
# Create a new Image to save the disk
|
||||
template = "NAME=\"#{image_name}\"\n"
|
||||
if image_type
|
||||
template << "TYPE=\"#{image_type}\"\n"
|
||||
else
|
||||
template << "TYPE=\"OS\"\n"
|
||||
end
|
||||
|
||||
image = Image.new(Image.build_xml, one_client)
|
||||
|
||||
rc = image.allocate(template)
|
||||
return rc, 400 if OpenNebula.is_error?(rc)
|
||||
|
||||
rc = vm.save_as(disk_id, image.id)
|
||||
rc = vm.save_as(disk_id, image_name)
|
||||
if OpenNebula.is_error?(rc)
|
||||
image.delete
|
||||
return rc, 400
|
||||
|
||||
Reference in new issue
Block a user