bug #3396: econe-register should accept both ami-ID or ID options as an arg

(cherry picked from commit 7e8693d6d7)
This commit is contained in:
Daniel Molina committed 2014-12-12 17:41:22 +01:00
1 parent da7b29738e
commit 8a0f49d8a4
1 file changed
+5 -1
+5 -1
View File
@@ -132,8 +132,12 @@ class EC2QueryServer < CloudServer
def register_image(params)
# Get the Image ID
image_id = params['ImageLocation']
image = ImageEC2.new(Image.build_xml(image_id.to_i), @client)
if image_id =~ /ami\-(.+)/
image_id = $1
end
image = ImageEC2.new(Image.build_xml(image_id.to_i), @client)
rc = image.info
if OpenNebula.is_error?(rc)
return rc