Files
nova/nova/api/metadata
Matt Riedemann 4317166b72 Handle keypair not found from metadata server
With commit e83842b80b we
attempt to load keypairs for an instance from instance_extra,
but if that hasn't been migrated yet we fall back to loading
the keypair from the database by name.

If the keypair was deleted, the instance object will just set
an empty KeyPairList for instance.keypairs and we'll get an
IndexError when using self.instance.keypairs[0] in
_metadata_as_json.

This adds a check that instance.keypairs actually has
something in it. If not, we log a message and don't return
any key values in the metadata dict - same as if instance.key_name
wasn't set to begin with.

Change-Id: If823867d1df4bafa46978e62e05826d1f12c9269
Closes-Bug: #1592167
2016-06-14 16:05:35 -04:00
..
2015-05-20 15:19:51 -07:00