Skip to content
Snippets Groups Projects
Commit 5875d333 authored by Jakub Maloštík's avatar Jakub Maloštík
Browse files

Fix warden server test init

This did not work for python 3.9 and 3.10 (each for a different reason)
The context management of the cursor, seems to have been an undocumented feature
for at least six years.
parent 104b3d9d
No related branches found
No related tags found
No related merge requests found
...@@ -412,7 +412,7 @@ def init_user(): ...@@ -412,7 +412,7 @@ def init_user():
conn = None conn = None
try: try:
conn = my.connect(user='root', passwd=getpass.getpass('Enter MySQL Root password:')) conn = my.connect(user='root', passwd=getpass.getpass('Enter MySQL Root password:'))
with conn as cur: # Not a canonical connector implementation, for sure with conn.cursor() as cur:
cur.execute("GRANT SELECT, INSERT, UPDATE, CREATE, DELETE, DROP ON *.* TO %s@'localhost' IDENTIFIED BY %s", (USER, PASSWORD)) cur.execute("GRANT SELECT, INSERT, UPDATE, CREATE, DELETE, DROP ON *.* TO %s@'localhost' IDENTIFIED BY %s", (USER, PASSWORD))
conn.commit() conn.commit()
print("DB User set up successfuly") print("DB User set up successfuly")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment