@@ -6,6 +6,7 @@ import shutil
|
||||
import stat
|
||||
import sys
|
||||
|
||||
from .. import package
|
||||
from .. import python
|
||||
from .. import utils
|
||||
|
||||
@@ -52,7 +53,7 @@ class Modoboa(base.Installer):
|
||||
packages.append("MYSQL-Python")
|
||||
if sys.version_info.major == 2 and sys.version_info.micro < 9:
|
||||
# Add extra packages to fix the SNI issue
|
||||
packages += ["pyOpenSSL", "ndg-httpsclient"]
|
||||
packages += ["pyOpenSSL"]
|
||||
python.install_packages(packages, self.venv_path, sudo_user=self.user)
|
||||
if self.devmode:
|
||||
# FIXME: use dev-requirements instead
|
||||
@@ -112,6 +113,18 @@ class Modoboa(base.Installer):
|
||||
prefix, " ".join(args)),
|
||||
sudo_user=self.user, cwd=self.home_dir)
|
||||
|
||||
def get_packages(self):
|
||||
"""Include extra packages if needed."""
|
||||
packages = super(Modoboa, self).get_packages()
|
||||
condition = (
|
||||
package.backend.FORMAT == "rpm" and
|
||||
sys.version_info.major == 2 and
|
||||
sys.version_info.micro < 9)
|
||||
if condition:
|
||||
# Add extra packages to fix the SNI issue
|
||||
packages += ["openssl-devel"]
|
||||
return packages
|
||||
|
||||
def get_template_context(self):
|
||||
"""Additional variables."""
|
||||
context = super(Modoboa, self).get_template_context()
|
||||
|
||||
@@ -33,6 +33,12 @@ class Razor(base.Installer):
|
||||
path = os.path.join(pw[5], ".razor")
|
||||
utils.mkdir(path, stat.S_IRWXU, pw[2], pw[3])
|
||||
utils.exec_cmd("razor-admin -home {} -create".format(path))
|
||||
utils.mkdir(
|
||||
self.config_dir,
|
||||
stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP |
|
||||
stat.S_IROTH | stat.S_IXOTH,
|
||||
0, 0
|
||||
)
|
||||
utils.copy_file(
|
||||
os.path.join(path, "razor-agent.conf"), self.config_dir)
|
||||
utils.exec_cmd("razor-admin -home {} -discover".format(path),
|
||||
|
||||
Reference in New Issue
Block a user