Use operation_name in OutputProcessor data

Using operation_type is not correct since it is simply "action" often.
Use the `operation_name` instead as we use in the metadata.

Change-Id: I8395df6816d9db25d9395b4372878abeab9c4110
This commit is contained in:
Artem Goncharov
2025-06-03 11:48:35 +02:00
parent 1a64217aec
commit 0088dd4e17
3 changed files with 3 additions and 2 deletions

View File

@@ -1102,6 +1102,7 @@ class RustCliGenerator(BaseGenerator):
context = {
"operation_id": operation_id,
"operation_type": args.operation_type,
"operation_name": args.operation_name,
"command_description": common_rust.sanitize_rust_docstrings(
command_description
),
@@ -1120,7 +1121,6 @@ class RustCliGenerator(BaseGenerator):
"service_type": args.service_type,
"url": path[1:] if path.startswith("/") else path,
"method": method,
"resource_key": None,
"resource_header_metadata": resource_header_metadata,
"sdk_mod_path": sdk_mod_path,
"cli_mod_path": cli_mod_path,

View File

@@ -119,7 +119,7 @@ impl {{ target_class_name }}Command {
) -> Result<(), OpenStackCliError> {
info!("{{ operation_type | title }} {{ target_class_name }}");
let op = OutputProcessor::from_args(parsed_args, Some("{{ resource_key }}"), Some("{{ operation_type }}"));
let op = OutputProcessor::from_args(parsed_args, Some("{{ resource_key }}"), Some("{{ operation_name }}"));
op.validate_args(parsed_args)?;
{%- if operation_type == "download" and is_image_download %}

View File

@@ -159,6 +159,7 @@ impl fooCommand {
sdk_service_name="srv",
resource_name="res",
operation_type="dummy",
operation_name="dummy",
microversion=None,
url="/url",
additional_imports={"foo::import", "bar::import"},