Added warning about user existence.

fix #74
This commit is contained in:
Antoine Nguyen
2017-01-17 15:34:21 +01:00
parent 42888ff0be
commit 6f89a86f64
2 changed files with 9 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ def install(appname, config):
if (config.has_option(appname, "enabled") and if (config.has_option(appname, "enabled") and
not config.getboolean(appname, "enabled")): not config.getboolean(appname, "enabled")):
return return
utils.printcolor("Installing {}".format(appname), utils.YELLOW) utils.printcolor("Installing {}".format(appname), utils.MAGENTA)
try: try:
script = importlib.import_module( script = importlib.import_module(
"modoboa_installer.scripts.{}".format(appname)) "modoboa_installer.scripts.{}".format(appname))

View File

@@ -14,6 +14,14 @@ def create_user(name, home=None):
except KeyError: except KeyError:
pass pass
else: else:
extra_message = "."
if home:
extra_message = (
" but please make sure the {} directory exists.".format(
home))
utils.printcolor(
"User {} already exists, skipping creation{}".format(
name, extra_message), utils.YELLOW)
return return
cmd = "useradd -m " cmd = "useradd -m "
if home: if home: