From 1a64217aec44ca2d9e07627b74fdbfa49f42890b Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Mon, 2 Jun 2025 11:17:25 +0200 Subject: [PATCH] Update the cli output initialization Switch to the new cli OutputProcessor initialization interface with resource_key and oepration_type parameters for enabling command specific hints. Change-Id: I67eaef1fd5f9f1ed72a5f11a23e8559739792f8a Signed-off-by: Artem Goncharov --- codegenerator/templates/rust_cli/impl.rs.j2 | 2 +- codegenerator/tests/unit/test_rust_cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegenerator/templates/rust_cli/impl.rs.j2 b/codegenerator/templates/rust_cli/impl.rs.j2 index a840c45..dfc84ea 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_with_resource_key(parsed_args, "{{ resource_key }}"); + let op = OutputProcessor::from_args(parsed_args, Some("{{ resource_key }}"), Some("{{ operation_type }}")); 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 c0983ad..86ea9d5 100644 --- a/codegenerator/tests/unit/test_rust_cli.py +++ b/codegenerator/tests/unit/test_rust_cli.py @@ -97,7 +97,7 @@ impl fooCommand { ) -> Result<(), OpenStackCliError> { info!("Dummy foo"); - let op = OutputProcessor::from_args_with_resource_key(parsed_args, "srv.foo"); + let op = OutputProcessor::from_args(parsed_args, Some("srv.foo"), Some("dummy")); op.validate_args(parsed_args)?; let mut ep_builder = srv::Request::builder();