Skip to content

Bug: Multi-line help strings throw an error in click.options #24006

@m11dedhia

Description

@m11dedhia

Is it platform specific

generic

Importance or Severity

Low

Description of the bug

When generating config commands for CLI using sonic-cli-gen generate config <yang_model>, fields having multi-line descriptions generate the python file while adding that description as a help string inside click.options using double quotes. This throws an error when invoking the config command for that yang model with the following error:

failed to import plugin config.plugins.auto.sonic-buffer-pool_yang: unterminated string literal (detected at line 287) (sonic-buffer-pool_yang.py, line 287)

In such a case, multi-line strings can be used to avoid this issue.

Steps to Reproduce

  1. Generate the config command for a model (eg. sonic-buffer-pool)
sonic-cli-gen generate config sonic-buffer-pool
  1. Call the config command
config buffer-pool

Actual Behavior and Expected Behavior

Actual Behavior:

failed to import plugin config.plugins.auto.sonic-buffer-pool_yang: unterminated string literal (detected at line 287) (sonic-buffer-pool_yang.py, line 287)

Expected Behavior:

Usage: config buffer-pool [OPTIONS] COMMAND [ARGS]...

Options:
  -h, -?, --help   Show this message and exit

Commands:
  add          Add object in BUFFER_POOL.
  delete      Delete object in BUFFER_POOL.
  update    Add object in BUFFER_POOL.

Relevant log output

Output of show version, show techsupport

Attach files (if any)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions