Fix the version decorators in Manila
Block storage schemas also have changed in the meanwhile (including well as clusters/put disappeared). Change-Id: Idb12b51397fd0b15a9fa731fe1d3118b4ba96411 Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
This commit is contained in:
@@ -1262,7 +1262,7 @@ class OpenStackServerSourceBase:
|
||||
) -> str:
|
||||
if ref_name == "_project_id":
|
||||
ref_name = "project_id"
|
||||
ref_name = ref_name.replace(":", "_")
|
||||
ref_name = ref_name.replace(":", "_").replace("~", "_")
|
||||
# Pop extensions for easier post processing
|
||||
if param_attrs:
|
||||
os_ext = param_attrs.pop("x-openstack", {})
|
||||
|
||||
@@ -317,8 +317,6 @@ VOLUME_PARAMETERS: dict[str, Any] = {
|
||||
},
|
||||
}
|
||||
|
||||
VOLUME_RESET_STATUS_SCHEMA: dict[str, Any] = admin_actions.reset
|
||||
|
||||
VOLUME_UPLOAD_IMAGE_RESPONSE_SCHEMA: dict[str, Any] = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -461,11 +459,6 @@ def _get_schema_ref(
|
||||
# Volume Actions
|
||||
elif name == "VolumesActionRevertResponse":
|
||||
return (None, None, True)
|
||||
elif name == "VolumesActionOs-Reset_StatusRequest":
|
||||
openapi_spec.components.schemas.setdefault(
|
||||
name, TypeSchema(**VOLUME_RESET_STATUS_SCHEMA)
|
||||
)
|
||||
ref = f"#/components/schemas/{name}"
|
||||
elif name in [
|
||||
"VolumesActionOs-Reset_StatusResponse",
|
||||
"VolumesActionOs-Force_DeleteResponse",
|
||||
|
||||
@@ -24,10 +24,16 @@ class ManilaGenerator(OpenStackServerSourceBase):
|
||||
URL_TAG_MAP = {"/versions": "version"}
|
||||
|
||||
def _api_ver_major(self, ver):
|
||||
return ver._ver_major
|
||||
if hasattr(ver, "_ver_major"):
|
||||
return ver._ver_major
|
||||
elif isinstance(ver, str) and "." in ver:
|
||||
return ver.split(".")[0]
|
||||
|
||||
def _api_ver_minor(self, ver):
|
||||
return ver._ver_minor
|
||||
if hasattr(ver, "_ver_minor"):
|
||||
return ver._ver_minor
|
||||
elif isinstance(ver, str) and "." in ver:
|
||||
return ver.split(".")[0]
|
||||
|
||||
def _api_ver(self, ver):
|
||||
return (ver._ver_major, ver._ver_minor)
|
||||
|
||||
@@ -328,16 +328,6 @@ resources:
|
||||
sdk_mod_name: get
|
||||
rust-sdk:
|
||||
module_name: get
|
||||
update:
|
||||
operation_id: clusters/id:put
|
||||
operation_type: set
|
||||
targets:
|
||||
rust-cli:
|
||||
cli_full_command: cluster set
|
||||
module_name: set
|
||||
sdk_mod_name: set
|
||||
rust-sdk:
|
||||
module_name: set
|
||||
spec_file: wrk/openapi_specs/block-storage/v3.yaml
|
||||
block-storage.consistencygroup:
|
||||
api_version: v3
|
||||
@@ -1307,16 +1297,6 @@ resources:
|
||||
sdk_mod_name: list
|
||||
rust-sdk:
|
||||
module_name: list
|
||||
update:
|
||||
operation_id: os-services/id:put
|
||||
operation_type: set
|
||||
targets:
|
||||
rust-cli:
|
||||
cli_full_command: service set
|
||||
module_name: set
|
||||
sdk_mod_name: set
|
||||
rust-sdk:
|
||||
module_name: set
|
||||
spec_file: wrk/openapi_specs/block-storage/v3.yaml
|
||||
block-storage.snapshot:
|
||||
api_version: v3
|
||||
|
||||
Reference in New Issue
Block a user