In Kilo, a patch landed to allow glance for returning None values. While
this was not an issue for the base and registered properties in the
`schema-image.json` file, it did break backwards compatibility for the
custom images created in V1 that have a vulue equal to None.
In order to restore compatibility, this changes returns empty strings
for those custom properties that exist in the database but that are not
part of the V2 schema. This strategy will help migrating such properties
when updates to the image data happens and it'll be a noop for just
reads.
We can't use a schema migration because we don't know off hand which of
the properties in the database are the ones that would need to be
migrated.
While we could skip this properties entirely, this patch prefers to send
the empty string back as a way to create awareness on the fact that
there's an empty property in the database. Since we didn't use to return
these properties, we can assume they weren't being used.
Reviewed: https:/ /review. openstack. org/189661 /git.openstack. org/cgit/ openstack/ glance/ commit/ ?id=ccea7b68567 afb2d5bb825d0ca bf247a9526bd93
Committed: https:/
Submitter: Jenkins
Branch: master
commit ccea7b68567afb2 d5bb825d0cabf24 7a9526bd93
Author: Flavio Percoco <email address hidden>
Date: Tue Jun 9 13:11:36 2015 +0200
Return empty str for permissive, none, properties
In Kilo, a patch landed to allow glance for returning None values. While image.json` file, it did break backwards compatibility for the
this was not an issue for the base and registered properties in the
`schema-
custom images created in V1 that have a vulue equal to None.
In order to restore compatibility, this changes returns empty strings
for those custom properties that exist in the database but that are not
part of the V2 schema. This strategy will help migrating such properties
when updates to the image data happens and it'll be a noop for just
reads.
We can't use a schema migration because we don't know off hand which of
the properties in the database are the ones that would need to be
migrated.
While we could skip this properties entirely, this patch prefers to send
the empty string back as a way to create awareness on the fact that
there's an empty property in the database. Since we didn't use to return
these properties, we can assume they weren't being used.
Closes-bug: #1419823 85fc98a612ca014 8a84123f5a2
Change-Id: I59bb27a892fe94