Code review comment for lp:~usc-isi/nova/instance_type_extra_specs

Revision history for this message
Lorin Hochstein (lorinh) wrote :

> This seems good. Just a question really. Why is the:
> inst_dict[i['name']] = _inst_type_query_to_dict(i)
>
> necessary. It seems like the joined load should handle populating the
> subobjects. If there is some reason to convert to nested dictionaries, is
> utils.to_primitive() lacking something that requires a custom method to be
> written?

Having gone over the code again, I now recall that a helper method is needed is to convert from:

'extra_specs': [{'key': 'k1', 'value': 'v1', ...}, {'key': 'k2', 'value': 'v2', ...}, ...]

to

'extra_specs': {'k1':'v1', 'k2':'v2', ...}

 I've renamed the helper method and modified the docstring to clarify this in the code.

« Back to merge proposal