Project

General

Profile

Revision e406049b

Added by Julien Enselme over 9 years ago

Add the hability to use this script if the database doesn't require a password.

View differences:

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

  

Also available in: Unified diff