Modoboa 1.6.1 compat.
This commit is contained in:
@@ -66,24 +66,11 @@ class Postfix(base.Installer):
|
|||||||
"""Additional tasks."""
|
"""Additional tasks."""
|
||||||
venv_path = self.config.get("modoboa", "venv_path")
|
venv_path = self.config.get("modoboa", "venv_path")
|
||||||
python_path = os.path.join(venv_path, "bin", "python")
|
python_path = os.path.join(venv_path, "bin", "python")
|
||||||
script_path = os.path.join(venv_path, "bin", "modoboa-admin.py")
|
instance_path = self.config.get("modoboa", "instance_path")
|
||||||
db_url = "{}://{}:{}@{}/{}".format(
|
script_path = os.path.join(instance_path, "manage.py")
|
||||||
self.dbengine, self.config.get("modoboa", "dbuser"),
|
|
||||||
self.config.get("modoboa", "dbpassword"),
|
|
||||||
self.dbhost, self.config.get("modoboa", "dbname"))
|
|
||||||
extensions = self.config.get("modoboa", "extensions")
|
|
||||||
exts_with_maps = ["modoboa-admin", "modoboa-admin-relaydomains",
|
|
||||||
"modoboa-postfix-autoreply"]
|
|
||||||
if extensions == "all":
|
|
||||||
extensions = exts_with_maps
|
|
||||||
else:
|
|
||||||
extensions = [ext for ext in exts_with_maps if ext in extensions]
|
|
||||||
if not extensions:
|
|
||||||
return
|
|
||||||
cmd = (
|
cmd = (
|
||||||
"{} {} postfix_maps --dbtype {} --extensions {} --dburl {} {}"
|
"{} {} generate_postfix_maps --destdir {} --force-overwrite"
|
||||||
.format(python_path, script_path, self.dbengine,
|
.format(python_path, script_path, self.config_dir))
|
||||||
" ".join(extensions), db_url, self.config_dir))
|
|
||||||
utils.exec_cmd(cmd)
|
utils.exec_cmd(cmd)
|
||||||
|
|
||||||
# Check chroot directory
|
# Check chroot directory
|
||||||
|
|||||||
Reference in New Issue
Block a user