summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-05-18 17:57:44 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-05-18 17:57:44 -0400
commitc69a1b0d9ef15ecc06217ec2c1ec4d73a755d14b (patch)
tree39b302c74f5f9e6299dba2553c9b6760f3db3003
parent76c98e277a405127d85cf2c264a20ec3a18e023a (diff)
return dummy id per vishs suggestion
-rw-r--r--nova/api/ec2/cloud.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 06b5f662f..950b72e72 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -157,12 +157,7 @@ class CloudController(object):
floating_ip = db.instance_get_floating_address(ctxt,
instance_ref['id'])
ec2_id = ec2utils.id_to_ec2_id(instance_ref['id'])
- try:
- image_ec2_id = self.image_ec2_id(instance_ref['image_id'])
- except ValueError:
- # not really an ec2_id here
- image_ec2_id = instance_ref['image_id']
-
+ image_ec2_id = self.image_ec2_id(instance_ref['image_id'])
data = {
'user-data': base64.b64decode(instance_ref['user_data']),
'meta-data': {
@@ -907,7 +902,12 @@ class CloudController(object):
def image_ec2_id(image_id, image_type='ami'):
"""Returns image ec2_id using id and three letter type."""
template = image_type + '-%08x'
- return ec2utils.id_to_ec2_id(int(image_id), template=template)
+ try:
+ return ec2utils.id_to_ec2_id(int(image_id), template=template)
+ except ValueError:
+ #TODO(wwolf): once we have ec2_id -> glance_id mapping
+ # in place, this wont be necessary
+ return "ami-00000000"
def _get_image(self, context, ec2_id):
try: