mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Grab the passwd from an envidonment variable, Daniel
This commit is contained in:
@ -126,7 +126,12 @@ def openMySQL(db="xmlsoft", passwd=None):
|
|||||||
global DB
|
global DB
|
||||||
|
|
||||||
if passwd == None:
|
if passwd == None:
|
||||||
passwd = "ducon"
|
try:
|
||||||
|
passwd = os.environ["MySQL_PASS"]
|
||||||
|
except:
|
||||||
|
print "No password available, set environment MySQL_PASS"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
DB = MySQLdb.connect(passwd=passwd, db=db)
|
DB = MySQLdb.connect(passwd=passwd, db=db)
|
||||||
if DB == None:
|
if DB == None:
|
||||||
return -1
|
return -1
|
||||||
|
Reference in New Issue
Block a user