Default value of JSONEncodedDict columns should be { } instead of "{ }"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic |
Fix Released
|
Low
|
Max Lobur |
Bug Description
There are a bunch of places where we putting "{ }" as default to the JSONEncodedDict column:
https:/
https:/
https:/
https:/
https:/
This leads to writing the db value as ' "{ }" ' (https:/
When the object is deserialized from the DB the property becomes string instead of dict, which may cause unexpected errors (due to interfaces mismatch). Currently we
don't have any problems with this because the UOM tries to deserialize the dict value again (https:/
But this looks like a workaround so it's better to fix the original problem
This is how it looks like in DB (Note that non-empy extra serialized as expected {} whereas empty extra is "{}") http://
I propose the following solution:
1. Remove all the places from DB API where JSONEncodedDict default is defined (all mentioned above)
2. Change JSONEncodedDict implementation to
def process_
if value is None:
value = dict()
value = json.dumps(value)
return value
summary: |
- Default value of JSONEncodedDict colums should be { } instead of "{ }" + Default value of JSONEncodedDict columns should be { } instead of "{ }" |
Changed in ironic: | |
importance: | Medium → Low |
description: | updated |
Changed in ironic: | |
milestone: | none → icehouse-3 |
status: | Fix Committed → Fix Released |
Changed in ironic: | |
milestone: | icehouse-3 → 2014.1 |
Fix proposed to branch: master /review. openstack. org/68413
Review: https:/