diff options
author | Ryan Lane <rlane@wikimedia.org> | 2011-02-08 05:58:51 +0000 |
---|---|---|
committer | Tarmac <> | 2011-02-08 05:58:51 +0000 |
commit | 4222e516f45a550cb8df245e71e4d4aef2a985b3 (patch) | |
tree | 065493a3da029cfc008f178eb173c5292c405e84 | |
parent | 0eb27a6805f5da4edb8a57a6953021c732a0b1c7 (diff) | |
parent | 15321719332a5b782ba5ac66d85db0eccc98ccba (diff) | |
download | nova-4222e516f45a550cb8df245e71e4d4aef2a985b3.tar.gz nova-4222e516f45a550cb8df245e71e4d4aef2a985b3.tar.xz nova-4222e516f45a550cb8df245e71e4d4aef2a985b3.zip |
Checks whether the instance id is a list or not before assignment. This is to fix a bug relating to nova/boto. The AWK-SDK libraries pass in a string, not a list. The euca tools pass in a list.
-rw-r--r-- | nova/api/ec2/cloud.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 00d044e95..c80e1168a 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -512,8 +512,11 @@ class CloudController(object): def get_console_output(self, context, instance_id, **kwargs): LOG.audit(_("Get console output for instance %s"), instance_id, context=context) - # instance_id is passed in as a list of instances - ec2_id = instance_id[0] + # instance_id may be passed in as a list of instances + if type(instance_id) == list: + ec2_id = instance_id[0] + else: + ec2_id = instance_id instance_id = ec2_id_to_id(ec2_id) output = self.compute_api.get_console_output( context, instance_id=instance_id) |