Better backup utility.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
import glob
|
||||
import pwd
|
||||
import shutil
|
||||
|
||||
from .. import database
|
||||
from .. import utils
|
||||
@@ -64,7 +63,7 @@ class Dovecot(base.Installer):
|
||||
self.get_file_path("fix_modoboa_postgres_schema.sql")
|
||||
)
|
||||
for f in glob.glob("{}/*".format(self.get_file_path("conf.d"))):
|
||||
shutil.copy(f, "{}/conf.d".format(self.config_dir))
|
||||
utils.copy_file(f, "{}/conf.d".format(self.config_dir))
|
||||
|
||||
def restart_daemon(self):
|
||||
"""Restart daemon process.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import os
|
||||
import pwd
|
||||
import shutil
|
||||
import stat
|
||||
|
||||
from .. import utils
|
||||
@@ -31,7 +30,8 @@ class Razor(base.Installer):
|
||||
path = os.path.join(self.config.get("amavis", "home_dir"), ".razor")
|
||||
utils.mkdir(path, stat.S_IRWXU, pw[2], pw[3])
|
||||
utils.exec_cmd("razor-admin -home {} -create".format(path))
|
||||
shutil.copy(os.path.join(path, "razor-agent.conf"), self.config_dir)
|
||||
utils.copy_file(
|
||||
os.path.join(path, "razor-agent.conf"), self.config_dir)
|
||||
utils.exec_cmd("razor-admin -home {} -discover".format(path),
|
||||
sudo_user=user)
|
||||
utils.exec_cmd("razor-admin -home {} -register".format(path),
|
||||
|
||||
Reference in New Issue
Block a user