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:
@@ -1102,6 +1102,7 @@ class RustCliGenerator(BaseGenerator):
|
|||||||
context = {
|
context = {
|
||||||
"operation_id": operation_id,
|
"operation_id": operation_id,
|
||||||
"operation_type": args.operation_type,
|
"operation_type": args.operation_type,
|
||||||
|
"operation_name": args.operation_name,
|
||||||
"command_description": common_rust.sanitize_rust_docstrings(
|
"command_description": common_rust.sanitize_rust_docstrings(
|
||||||
command_description
|
command_description
|
||||||
),
|
),
|
||||||
@@ -1120,7 +1121,6 @@ class RustCliGenerator(BaseGenerator):
|
|||||||
"service_type": args.service_type,
|
"service_type": args.service_type,
|
||||||
"url": path[1:] if path.startswith("/") else path,
|
"url": path[1:] if path.startswith("/") else path,
|
||||||
"method": method,
|
"method": method,
|
||||||
"resource_key": None,
|
|
||||||
"resource_header_metadata": resource_header_metadata,
|
"resource_header_metadata": resource_header_metadata,
|
||||||
"sdk_mod_path": sdk_mod_path,
|
"sdk_mod_path": sdk_mod_path,
|
||||||
"cli_mod_path": cli_mod_path,
|
"cli_mod_path": cli_mod_path,
|
||||||
|
@@ -119,7 +119,7 @@ impl {{ target_class_name }}Command {
|
|||||||
) -> Result<(), OpenStackCliError> {
|
) -> Result<(), OpenStackCliError> {
|
||||||
info!("{{ operation_type | title }} {{ target_class_name }}");
|
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)?;
|
op.validate_args(parsed_args)?;
|
||||||
|
|
||||||
{%- if operation_type == "download" and is_image_download %}
|
{%- if operation_type == "download" and is_image_download %}
|
||||||
|
@@ -159,6 +159,7 @@ impl fooCommand {
|
|||||||
sdk_service_name="srv",
|
sdk_service_name="srv",
|
||||||
resource_name="res",
|
resource_name="res",
|
||||||
operation_type="dummy",
|
operation_type="dummy",
|
||||||
|
operation_name="dummy",
|
||||||
microversion=None,
|
microversion=None,
|
||||||
url="/url",
|
url="/url",
|
||||||
additional_imports={"foo::import", "bar::import"},
|
additional_imports={"foo::import", "bar::import"},
|
||||||
|
Reference in New Issue
Block a user