Copied my comment about the metadata validation point from change #141311 for other folks who interested on this point:
More thinking on metadata checking stuff widely. Currently we have two points need to make sure metadata is valid: a) new added image should has a proper metadata with its location, this happened on image adding operation, and metadata provided by configured 'filesystem_store_metadata_file' content; b) new added image location should has a correct formatted metadata, this happened on location adding operation by PATCH api, and metadata provided by end user directly. I consider we need to do the same validation for there two points which you provided in this patch, now we only use 'check_location_metadata()' [0][1] to make sure metadata only contains required dict and unicode string instead of json schema like you did here. In feature, I think we need to expose a new interface for store driver like 'check_location_metadata', and calling it in store internal to cover point #a, and calling it at [0] to cover point #b.
Copied my comment about the metadata validation point from change #141311 for other folks who interested on this point:
More thinking on metadata checking stuff widely. Currently we have two points need to make sure metadata is valid: a) new added image should has a proper metadata with its location, this happened on image adding operation, and metadata provided by configured 'filesystem_ store_metadata_ file' content; b) new added image location should has a correct formatted metadata, this happened on location adding operation by PATCH api, and metadata provided by end user directly. I consider we need to do the same validation for there two points which you provided in this patch, now we only use 'check_ location_ metadata( )' [0][1] to make sure metadata only contains required dict and unicode string instead of json schema like you did here. In feature, I think we need to expose a new interface for store driver like 'check_ location_ metadata' , and calling it in store internal to cover point #a, and calling it at [0] to cover point #b.
[0] https:/ /github. com/openstack/ glance/ blob/master/ glance/ location. py#L93 /github. com/openstack/ glance_ store/blob/ master/ glance_ store/backend. py#L297
[1] https:/