small fixes

This commit is contained in:
Charlie Jacomme 2018-08-08 17:22:01 +02:00
parent d9101e710f
commit 5b88781fe0

4
main.py Normal file → Executable file
View file

@ -23,9 +23,9 @@ api_client = Re2oAPIClient(api_hostname, api_username, api_password)
client_hostname = socket.gethostname().split('.', 1)[0] client_hostname = socket.gethostname().split('.', 1)[0]
all_users = api_client.list("localemail/users")
def generate(api_client): def generate(api_client):
all_users = api_client.list("localemail/users")
# Création de l'environnement Jinja # Création de l'environnement Jinja
env = Environment(loader=FileSystemLoader('.')) env = Environment(loader=FileSystemLoader('.'))
template = env.get_template('templates/list') template = env.get_template('templates/list')
@ -42,7 +42,7 @@ def generate(api_client):
fichier.write(aliases_rendered) fichier.write(aliases_rendered)
fichier.close() fichier.close()
call(["newalias", "generated/aliases"]) # Update the aliases config file call(["/usr/bin/newaliases"]) # Update the aliases config file
call(["postfix", "reload"]) # force the reloading now call(["postfix", "reload"]) # force the reloading now
for service in api_client.list("services/regen/"): for service in api_client.list("services/regen/"):