Révision e406049b
Ajouté par Julien Enselme il y a plus de 9 ans
other-scripts/fix-cas.py | ||
---|---|---|
8 | 8 |
def fix_cas(db, host, user, password, prefix, roles): |
9 | 9 |
import pymysql as mysql |
10 | 10 |
|
11 |
while not password:
|
|
12 |
password = getpass('Please enter the password: ')
|
|
13 |
password = password.strip()
|
|
14 |
|
|
15 |
conn = mysql.connect(host=host, user=user, passwd=password, db=db, charset='utf8') |
|
11 |
if not password:
|
|
12 |
conn = mysql.connect(host=host, user=user, db=db, charset='utf8')
|
|
13 |
else:
|
|
14 |
conn = mysql.connect(host=host, user=user, passwd=password, db=db, charset='utf8') |
|
15 |
|
|
16 | 16 |
with conn: |
17 | 17 |
cur = conn.cursor() |
18 | 18 |
|
Formats disponibles : Unified diff
Add the hability to use this script if the database doesn't require a password.