Code review comment for lp://qastaging/~justin-fathomdb/nova/justinsb-api-fix-imageid

Revision history for this message
Rick Harris (rconradharris) wrote :

> 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'))

« Back to merge proposal