diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-21 18:23:54 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-21 18:23:54 +0000 |
| commit | 5582d203b77741a005687a87673d9fce11b5ee09 (patch) | |
| tree | 94db2b92daae343a37298b023769e12985b7511a /nova/api | |
| parent | 2622f40af702ddaa76fd6fa8519f6f2438f85da8 (diff) | |
| parent | c3639847011566f39a7bd08e29bab4a72847a333 (diff) | |
Merge "Handle instances not being found in EC2 API responses."
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/ec2utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nova/api/ec2/ec2utils.py b/nova/api/ec2/ec2utils.py index d5beb017f..1c2ceea6f 100644 --- a/nova/api/ec2/ec2utils.py +++ b/nova/api/ec2/ec2utils.py @@ -127,7 +127,9 @@ def id_to_ec2_id(instance_id, template='i-%08x'): def id_to_ec2_inst_id(instance_id): """Get or create an ec2 instance ID (i-[base 16 number]) from uuid.""" - if uuidutils.is_uuid_like(instance_id): + if instance_id is None: + return None + elif uuidutils.is_uuid_like(instance_id): ctxt = context.get_admin_context() int_id = get_int_id_from_instance_uuid(ctxt, instance_id) return id_to_ec2_id(int_id) |
