mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
Fix for SAVE_AS bug through the OCCI interface
This commit is contained in:
parent
cbb3f33f6c
commit
9fed541625
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user