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

[sonic-installer] Hyphens instead of underscores in command and subcommands #983

Merged
merged 14 commits into from
Jul 14, 2020
Merged

[sonic-installer] Hyphens instead of underscores in command and subcommands #983

merged 14 commits into from
Jul 14, 2020

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Jul 11, 2020

Replace underscores with hyphens in all sonic-installer subcommands as well as the root command itself.

  • Install two entry points for sonic-installer: sonic-installer and sonic_installer. This allows for backward compatibility and time for users to transition from using the underscore versions to the hyphenated versions.

  • Replace underscores with hyphens in the following subcommands:

    set-default
    set-next-boot
    binary-version
    upgrade-docker
    rollback-docker
    
    • Also add aliases from the underscore versions of these subcommnds to the new hyphenated subcommands to allow for backward compatibility and time for users to transition from using the underscore versions to the hyphenated versions.
  • Print deprecation warnings to stderr if issued command line contains any deprecated versions with underscores

  • Bonus: Addition of the AliasedGroup base class also adds support for abbreviated subcommands

  • Fixed some style issues which did not align with PEP8 standards

  • Eliminate duplicate code by adding DOCKER_CONTAINER_LIST; Remove unknown 'amon' container from the list

This is work towards resolving issue #982. We can set a deprecation date for the underscore versions of the commands, and when that date arrives, we can simply delete all aliases and deprecation warnings.

setup.py Outdated Show resolved Hide resolved
@jleveque jleveque changed the title [sonic-installer] Hyphens instead of underscores in commands/subcommands [sonic-installer] Hyphens instead of underscores in command/subcommands Jul 11, 2020
@jleveque jleveque changed the title [sonic-installer] Hyphens instead of underscores in command/subcommands [sonic-installer] Hyphens instead of underscores in command and subcommands Jul 11, 2020
@sonic-net sonic-net deleted a comment from lgtm-com bot Jul 11, 2020
sonic_installer/main.py Outdated Show resolved Hide resolved
@jleveque
Copy link
Contributor Author

Retest this please

@jleveque jleveque merged commit a23479e into sonic-net:master Jul 14, 2020
@jleveque jleveque deleted the sonic_utilities_hyphens branch July 14, 2020 03:57
jleveque added a commit that referenced this pull request Jul 19, 2020
#995)

Root group name was changed from `cli` to `sonic_installer` in #983. However, `verify-next-image` subcommand was being added in an already-open PR #979 at the time. It did not get updated before merge. This aligns it with the new group name.
jleveque added a commit that referenced this pull request Sep 1, 2020
Ensure aliases.ini gets installed with the sonic_installer package to enable backward-compatibility with the versions of subcommands which contain underscores.

This was missed in #983
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
…d (#995)

Root group name was changed from `cli` to `sonic_installer` in sonic-net/sonic-utilities#983. However, `verify-next-image` subcommand was being added in an already-open PR sonic-net/sonic-utilities#979 at the time. It did not get updated before merge. This aligns it with the new group name.
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
Ensure aliases.ini gets installed with the sonic_installer package to enable backward-compatibility with the versions of subcommands which contain underscores.

This was missed in sonic-net/sonic-utilities#983
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants