Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fwutil show command has conflicting subcommands #8924

Closed
alexrallen opened this issue Oct 8, 2021 · 1 comment
Closed

fwutil show command has conflicting subcommands #8924

alexrallen opened this issue Oct 8, 2021 · 1 comment
Assignees
Labels
Triaged this issue has been triaged

Comments

@alexrallen
Copy link
Contributor

Description

There are two conflicting sub-commands defined for fwutil show

One was recently added here: https://github.com/Azure/sonic-utilities/blob/1029c5487dd1190215dae6ca557d6feb96113c9d/fwutil/main.py#L465

# 'updates' subcommand
@click.group()
@click.pass_context
def show_update(ctx):
    """status : Show platform components auto_update status"""
    pass


# 'status' subcommand
@show_update.command(name='status')
@click.pass_context
def update_status(ctx):
    """Show platform components auto_update status"""
    try:
        csp = ComponentStatusProvider()
        click.echo(csp.get_au_status())
    except Exception as e:
        cli_abort(ctx, str(e))


# 'version' subcommand
@show.command()
def version():
    """Show utility version"""
    click.echo("fwutil version {0}".format(VERSION))

show.add_command(show_update, name='update')

The other was added originally here: https://github.com/Azure/sonic-utilities/blob/1029c5487dd1190215dae6ca557d6feb96113c9d/fwutil/main.py#L406

# 'updates' subcommand
@show.command()
@click.option('-i', '--image', 'image', type=click.Choice(["current", "next"]), default="current", show_default=True, help="Show updates using current/next SONiC image")
@click.option('-f', '--fw_image', 'fw_image', help="Custom FW package path")
@click.pass_context
def updates(ctx, image=None, fw_image=None):
    """Show available updates"""
    try:
        squashfs = None
        fwpackage = None
        cup = None

....

These are causing issues with the tab-complete CLI helper.

Steps to reproduce the issue:

  1. Type fwutil show
  2. Hit tab

Describe the results you received:

root@r-qa-sw-eth-21101:/home/admin# fwutil show up
show     updates  
root@r-qa-sw-eth-21101:/home/admin# fwutil show 
show     status   updates  version  

Describe the results you expected:

root@r-qa-sw-eth-21101:/home/admin# fwutil show up
updates  
root@r-qa-sw-eth-21101:/home/admin# fwutil show 
status   updates  version  
@dgsudharsan
Copy link
Collaborator

@sujinmkang FYI

@zhangyanzhao zhangyanzhao added the Triaged this issue has been triaged label Oct 13, 2021
qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this issue Apr 29, 2022
…ot fw update (#2040)

sonic-net/sonic-buildimage#8928
sonic-net/sonic-buildimage#8926
sonic-net/sonic-buildimage#8925
sonic-net/sonic-buildimage#8924

#### What I did
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How I did it
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How to verify it
1. Run fwutil update all for boot_type="none"
2. Run fwutil update all for any other boot_type
3. Verify if the 2nd update is proceeded.
judyjoseph pushed a commit to sonic-net/sonic-utilities that referenced this issue May 2, 2022
…ot fw update (#2040)

sonic-net/sonic-buildimage#8928
sonic-net/sonic-buildimage#8926
sonic-net/sonic-buildimage#8925
sonic-net/sonic-buildimage#8924

#### What I did
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How I did it
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How to verify it
1. Run fwutil update all for boot_type="none"
2. Run fwutil update all for any other boot_type
3. Verify if the 2nd update is proceeded.
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this issue Aug 3, 2023
…ot fw update (#2040)

sonic-net/sonic-buildimage#8928
sonic-net/sonic-buildimage#8926
sonic-net/sonic-buildimage#8925
sonic-net/sonic-buildimage#8924

#### What I did
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How I did it
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How to verify it
1. Run fwutil update all for boot_type="none"
2. Run fwutil update all for any other boot_type
3. Verify if the 2nd update is proceeded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

4 participants