Changeset View
Changeset View
Standalone View
Standalone View
pykolab/setup/setup_syncroton.py
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | for root, directories, filenames in os.walk('/usr/share/doc/'): | ||||
break | break | ||||
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( | print >> sys.stderr, utils.multiline_message( | ||||
"""Please supply the MySQL root password""" | """Please supply the MySQL root password (use 'unix_socket' for socket based authentication)""" | ||||
) | ) | ||||
mysql_root_password = utils.ask_question( | mysql_root_password = utils.ask_question( | ||||
_("MySQL root password"), | _("MySQL root password"), | ||||
password=True | 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 = """ | |||||
[mysql] | |||||
user=root | |||||
password='%s' | |||||
host=%s | |||||
""" % (mysql_root_password, conf.mysqlhost) | |||||
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') | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |