diff --git a/codegenerator/rust_cli.py b/codegenerator/rust_cli.py index 90d7cff..b4d5f91 100644 --- a/codegenerator/rust_cli.py +++ b/codegenerator/rust_cli.py @@ -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, diff --git a/codegenerator/templates/rust_cli/impl.rs.j2 b/codegenerator/templates/rust_cli/impl.rs.j2 index dfc84ea..0986a98 100644 --- a/codegenerator/templates/rust_cli/impl.rs.j2 +++ b/codegenerator/templates/rust_cli/impl.rs.j2 @@ -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 %} diff --git a/codegenerator/tests/unit/test_rust_cli.py b/codegenerator/tests/unit/test_rust_cli.py index 86ea9d5..dcae85a 100644 --- a/codegenerator/tests/unit/test_rust_cli.py +++ b/codegenerator/tests/unit/test_rust_cli.py @@ -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"},