Skip to content

Commit

Permalink
fix: update command options
Browse files Browse the repository at this point in the history
  • Loading branch information
Danyal-Faheem committed Nov 24, 2024
1 parent f0aebb6 commit db5c8ba
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tutor/commands/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@ def sqlshell(args: list[str]) -> t.Iterable[tuple[str, str]]:


@click.command(context_settings={"ignore_unknown_options": True})
@click.option(
"--users",
@click.argument(
"users",
is_flag=False,
nargs=1,
help="Specific users to upgrade the authentication plugin of. Requires comma-seperated values with no space in-between.",
nargs=-1,
help="Update the authentication plugin of one or more users. Specify 'all' to update all users at once.",
)
@click.pass_obj
def update_mysql_authentication_plugin(
context: Context, users: str
context: Context, users: tuple[str]
) -> t.Iterable[tuple[str, str]]:
"""
Update the authentication plugin of MySQL users from mysql_native_password to caching_sha2_password
Expand All @@ -342,7 +342,9 @@ def update_mysql_authentication_plugin(
)
return

users_to_update = users.split(",") if users else list(plugins.iter_loaded())
update_all = "all" in users

users_to_update = list(plugins.iter_loaded()) if update_all else users.split(",")

query = get_mysql_change_authentication_plugin_query(
config, users_to_update, not users
Expand Down

0 comments on commit db5c8ba

Please sign in to comment.