Changeset View
Changeset View
Standalone View
Standalone View
pykolab/setup/setup_roundcube.py
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Line(s) | |||||
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', 0600) | os.chmod('/tmp/kolab-setup-my.cnf', 0o600) | ||||
fp.write(data) | fp.write(data) | ||||
fp.close() | fp.close() | ||||
p1 = subprocess.Popen(['echo', 'create database roundcube;'], stdout=subprocess.PIPE) | p1 = subprocess.Popen(['echo', 'create database roundcube;'], stdout=subprocess.PIPE) | ||||
p2 = subprocess.Popen(['mysql', '--defaults-file=/tmp/kolab-setup-my.cnf'], stdin=p1.stdout) | p2 = subprocess.Popen(['mysql', '--defaults-file=/tmp/kolab-setup-my.cnf'], stdin=p1.stdout) | ||||
p1.stdout.close() | p1.stdout.close() | ||||
p2.communicate() | p2.communicate() | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |