1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-28 14:50:08 +03:00

feature #2259: Check if the image is registered in scone

Images must include the EC2_AMI parameter to be used through econe
	This parameter is included in the image using the RegisterImage call
This commit is contained in:
Daniel Molina 2013-10-30 16:19:20 +01:00
parent da1103733e
commit 096fe5179b

View File

@ -65,6 +65,13 @@ module Instance
img = nil
if params['ImageId'] =~ /ami\-(.+)/
img = $1
image = ImageEC2.new(Image.build_xml(img), @client)
rc = image.info
if OpenNebula.is_error?(rc) || !image.ec2_ami?
rc ||= OpenNebula::Error.new()
rc.ec2_code = "InvalidAMIID.NotFound"
return rc
end
else
rc = OpenNebula::Error.new("InvalidAMIID.Malformed #{params['ImageId']}")
rc.ec2_code = "InvalidAMIID.Malformed"