~blamar/nova/gracefull-shutdown

« back to all changes in this revision

Viewing changes to nova/api/ec2/cloud.py

  • Committer: Tarmac
  • Author(s): Dan Prince
  • Date: 2011-06-30 13:25:41 UTC
  • mfrom: (1230.1.1 fix_ec2_metadata)
  • Revision ID: tarmac-20110630132541-f5jaivh2hedpo5vm
Update the ec2 get_metadata handler so it works with the most recent version of the compute API get_all call which now returns a list if there is only a single record.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
 
153
153
        # This ensures that all attributes of the instance
154
154
        # are populated.
155
 
        instance_ref = db.instance_get(ctxt, instance_ref['id'])
 
155
        instance_ref = db.instance_get(ctxt, instance_ref[0]['id'])
156
156
 
157
157
        mpi = self._get_mpi_data(ctxt, instance_ref['project_id'])
158
158
        if instance_ref['key_name']: