Merge lp://qastaging/~justin-fathomdb/nova/justinsb-api-fix-imageid into lp://qastaging/~hudson-openstack/nova/trunk
Proposed by
justinsb
Status: | Work in progress |
---|---|
Proposed branch: | lp://qastaging/~justin-fathomdb/nova/justinsb-api-fix-imageid |
Merge into: | lp://qastaging/~hudson-openstack/nova/trunk |
Diff against target: |
18 lines (+6/-2) 1 file modified
nova/api/openstack/images.py (+6/-2) |
To merge this branch: | bzr merge lp://qastaging/~justin-fathomdb/nova/justinsb-api-fix-imageid |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Devin Carlen (community) | Disapprove | ||
Jay Pipes (community) | Disapprove | ||
Rick Harris (community) | Approve | ||
Review via email:
|
Description of the change
When using objectstore instead of glance, the OpenStack API was returning non-numeric image ids.
To post a comment you must log in.
> 10 + if not image_id:
Potential issue (not sure if this happens in reality): if `imageId` returned was `0` then we'd erroneously use the `id` attribute.
`if image_id is not None` seems better in this case.
Also, if `imageId` isn't present (as is the case with Glance), wouldn't a KeyError be raised?
Wondering if it should be `image. get('imageId' , None)` instead. Or even,
image_id = image.get( 'imageId' , image.get('id'))