Changeset View
Changeset View
Standalone View
Standalone View
pykolab/setup/setup_roundcube.py
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | for root, directories, filenames in os.walk('/usr/share/doc/'): | ||||
schema_files.append(schema_filepath) | schema_files.append(schema_filepath) | ||||
if len(schema_files) > 0: | if len(schema_files) > 0: | ||||
break | break | ||||
if len(schema_files) > 0: | if len(schema_files) > 0: | ||||
break | break | ||||
if not os.path.isfile('/tmp/kolab-setup-my.cnf'): | if not os.path.isfile('/tmp/kolab-setup-my.cnf'): | ||||
utils.multiline_message("""Please supply the MySQL root password""") | print >> sys.stderr, utils.multiline_message( | ||||
"""Please supply the MySQL root password (use 'unix_socket' for socket based authentication)""" | |||||
) | |||||
mysql_root_password = utils.ask_question("MySQL root password", password=True) | mysql_root_password = utils.ask_question( | ||||
_("MySQL root password"), | |||||
password=True | |||||
) | |||||
socket_path = None | |||||
socket_paths = [ | |||||
"/var/lib/mysql/mysql.sock", | |||||
"/var/run/mysqld/mysqld.sock", | |||||
"/var/run/mysql/mysql.sock" | |||||
] | |||||
for sp in socket_paths: | |||||
if os.path.exists(sp): | |||||
socket_path = sp | |||||
if mysql_root_password == "unix_socket" and socket_path is not None: | |||||
data = """ | |||||
[mysql] | |||||
user=root | |||||
password= | |||||
host=localhost | |||||
socket=%s | |||||
""" % (socket_path) | |||||
else: | |||||
data = """ | data = """ | ||||
[mysql] | [mysql] | ||||
user=root | user=root | ||||
password='%s' | password='%s' | ||||
host=%s | host=%s | ||||
""" % (mysql_root_password, conf.mysqlhost) | """ % (mysql_root_password, conf.mysqlhost) | ||||
fp = open('/tmp/kolab-setup-my.cnf', 'w') | fp = open('/tmp/kolab-setup-my.cnf', 'w') | ||||
os.chmod('/tmp/kolab-setup-my.cnf', 600) | os.chmod('/tmp/kolab-setup-my.cnf', 600) | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |