Update cluster.py

This commit is contained in:
alesapin 2020-09-14 10:01:20 +03:00 committed by GitHub
parent 1e849f2975
commit 0c04f4d008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1165,11 +1165,12 @@ class ClickHouseInstance:
db_dir = p.abspath(p.join(self.path, 'database'))
print "Setup database dir {}".format(db_dir)
os.mkdir(db_dir)
if self.clickhouse_path_dir is not None:
print "Database files taken from {}".format(self.clickhouse_path_dir)
shutil.copytree(self.clickhouse_path_dir, db_dir)
print "Database copied from {} to {}".format(self.clickhouse_path_dir, db_dir)
else:
os.mkdir(db_dir)
logs_dir = p.abspath(p.join(self.path, 'logs'))
print "Setup logs dir {}".format(logs_dir)