3 from wizard import shell
5 def get_sql_credentials():
7 Attempts to determine a user's MySQL credentials. They are
8 returned as a three-tuple (host, user, password).
11 host = os.getenv("WIZARD_MYSQL_HOST")
12 user = os.getenv("WIZARD_MYSQL_USER")
13 password = os.getenv("WIZARD_MYSQL_PASSWORD")
14 if host is not None and user is not None and password is not None:
15 return (host, user, password)
17 return sh.eval("/mit/scripts/sql/bin/get-password").split()