Changeset View
Changeset View
Standalone View
Standalone View
pykolab/setup/setup_syncroton.py
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | """ % (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') | ||||
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() | ||||
for schema_file in schema_files: | for schema_file in schema_files: | ||||
p1 = subprocess.Popen(['cat', schema_file], stdout=subprocess.PIPE) | p1 = subprocess.Popen(['cat', schema_file], stdout=subprocess.PIPE) | ||||
p2 = subprocess.Popen(['mysql', '--defaults-file=/tmp/kolab-setup-my.cnf', 'roundcube'], stdin=p1.stdout) | p2 = subprocess.Popen(['mysql', '--defaults-file=/tmp/kolab-setup-my.cnf', 'roundcube'], stdin=p1.stdout) | ||||
p1.stdout.close() | p1.stdout.close() | ||||
p2.communicate() | p2.communicate() | ||||
Show All 33 Lines |