Skip to content

Commit

Permalink
refactor: update mysql query definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Danyal-Faheem committed Jan 16, 2025
1 parent cb1d1fa commit 216d0fd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tutor/commands/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,17 @@ def update_mysql_authentication_plugin(

query = f"ALTER USER IF EXISTS '{user}'@'{host}' IDENTIFIED with caching_sha2_password BY '{password}';"

mysql_command = (
"mysql --user={{ MYSQL_ROOT_USERNAME }} --password={{ MYSQL_ROOT_PASSWORD }} --host={{ MYSQL_HOST }} --port={{ MYSQL_PORT }} --database={{ OPENEDX_MYSQL_DATABASE }} --show-warnings "
+ shlex.join(["-e", query])
)

yield ("lms", mysql_command)
yield ("lms", shlex.join([
"mysql",
"--user={{ MYSQL_ROOT_USERNAME }}",
"--password={{ MYSQL_ROOT_PASSWORD }}",
"--host={{ MYSQL_HOST }}",
"--port={{ MYSQL_PORT }}",
"--database={{ OPENEDX_MYSQL_DATABASE }}",
"--show-warnings",
"-e",
query,
]))


def add_job_commands(do_command_group: click.Group) -> None:
Expand Down

0 comments on commit 216d0fd

Please sign in to comment.