Merge lp:~vishvananda/nova/fix-mpi into lp:~hudson-openstack/nova/trunk

Proposed by Vish Ishaya
Status: Merged
Approved by: Jesse Andrews
Approved revision: 276
Merged at revision: 287
Proposed branch: lp:~vishvananda/nova/fix-mpi
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 18 lines (+4/-3)
1 file modified
nova/endpoint/cloud.py (+4/-3)
To merge this branch: bzr merge lp:~vishvananda/nova/fix-mpi
Reviewer Review Type Date Requested Status
Joshua McKenty (community) Approve
Jesse Andrews (community) Approve
Review via email: mp+35752@code.launchpad.net

Commit message

Fixes server error on get metadata when instances are started without keypairs.

Description of the change

Simple fix to extra metadata. Key data is coming back from the database as None, and the metadata translation code dies on Non-string dictionary keys. This simply converts None into the string 'None'

To post a comment you must log in.
Revision history for this message
Jesse Andrews (anotherjesse) wrote :

lgtm

review: Approve
Revision history for this message
Joshua McKenty (joshua-mckenty) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/endpoint/cloud.py'
2--- nova/endpoint/cloud.py 2010-09-11 11:01:44 +0000
3+++ nova/endpoint/cloud.py 2010-09-16 22:24:50 +0000
4@@ -88,10 +88,11 @@
5 if instance['fixed_ip']:
6 line = '%s slots=%d' % (instance['fixed_ip']['str_id'],
7 INSTANCE_TYPES[instance['instance_type']]['vcpus'])
8- if instance['key_name'] in result:
9- result[instance['key_name']].append(line)
10+ key = str(instance['key_name'])
11+ if key in result:
12+ result[key].append(line)
13 else:
14- result[instance['key_name']] = [line]
15+ result[key] = [line]
16 return result
17
18 def get_metadata(self, address):