Make image.locations.metadata not required
Glance defines metadata property of the image location as mandatory while in devstack it is not present. Hardcode a dirty fix for the schema. Change-Id: I15f2f0a543174eccbeb5c0d4da9e5222ce1e5d7a Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
This commit is contained in:
1 changed files with 11 additions and 0 deletions
@@ -739,6 +739,9 @@ class GlanceGenerator(OpenStackServerSourceBase):
res["properties"]["images"]["items"]["properties"][
"disk_format"
] = self.fix_image_x_format_schema(cf)
res["properties"]["images"]["items"]["properties"][
"locations"
]["items"]["required"].remove("metadata")
elif name in ["ImagesCreateRequest"]:
cf = res["properties"]["container_format"]
# TODO: Once a way to deal with this in CLI is found uncomment it
@@ -749,6 +752,9 @@ class GlanceGenerator(OpenStackServerSourceBase):
# res["properties"]["disk_format"] = (
# self.fix_image_x_format_schema(cf)
# )
res["properties"]["locations"]["items"]["required"].remove(
"metadata"
)
elif name in [
"ImageShowResponse",
"ImagesCreateResponse",
@@ -764,15 +770,20 @@ class GlanceGenerator(OpenStackServerSourceBase):
res["properties"]["disk_format"] = (
self.fix_image_x_format_schema(cf)
)
res["properties"]["locations"]["items"]["required"].remove(
"metadata"
)
elif name in [
"ImagesLocationsGet_LocationsResponse",
"ImagesLocationsAdd_LocationResponse",
]:
if "locations" in res["properties"]:
res = res["properties"]["locations"]
res["items"]["required"].remove("metadata")
elif name == "ImagesLocationsAdd_LocationRequest":
if "locations" in res["properties"]:
res = res["properties"]["locations"]["items"]
res["required"].remove("metadata")
elif name == "MetadefsNamespacesPropertiesListResponse":
res["properties"]["properties"]["additionalProperties"][
"type"
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.