Skip to content

Commit

Permalink
Addon arguments should not raise warnings (#3913)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos authored Apr 11, 2023
1 parent 9369244 commit ba9076b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/wrappers/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,6 @@ def unprotected_xable(action: str, addon_args: list):
:param addons: List of addons to enable. Each addon may be prefixed with `repository/`
to specify which addon repository it will be sourced from.
"""
if len(addon_args) > 1:
click.echo(
"WARNING: Do not enable or disable multiple addons in one command.\n"
" This form of chained operations on addons will be DEPRECATED in the future.\n"
f" Please, {action} one addon at a time: 'microk8s {action} <addon>'"
)
available_addons_info = get_available_addons(get_current_arch())
enabled_addons_info, disabled_addons_info = get_status(available_addons_info, True)
if action == "enable":
Expand All @@ -539,6 +533,12 @@ def unprotected_xable(action: str, addon_args: list):
xabled_addons = [(addon["repository"], addon["name"]) for addon in xabled_addons_info]

addons = parse_xable_addon_args(addon_args, available_addons)
if len(addons) > 1:
click.echo(
"WARNING: Do not enable or disable multiple addons in one command.\n"
" This form of chained operations on addons will be DEPRECATED in the future.\n"
f" Please, {action} one addon at a time: 'microk8s {action} <addon>'"
)

for repo_name, addon_name, args in addons:
if (repo_name, addon_name) not in available_addons:
Expand Down

0 comments on commit ba9076b

Please sign in to comment.