From d8499579e3ac5d9b03f7e28332a204184cc3909e Mon Sep 17 00:00:00 2001 From: Maxime Bombar Date: Sun, 30 Dec 2018 00:27:14 +0100 Subject: [PATCH] [mail-server] Uses built-in subprocess.DEVNULL instead of opening dev/null --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index b8ac418..4d7931b 100755 --- a/main.py +++ b/main.py @@ -9,7 +9,7 @@ from jinja2 import Environment, FileSystemLoader import requests import base64 import json -from subprocess import call +from subprocess import call, DEVNULL import os import sys @@ -61,8 +61,8 @@ def generate(api_client): fichier.write(virtuals_rendered) fichier.close() - call(["/usr/bin/newaliases"], stdout=open(os.devnull, 'wb')) # Update the aliases config file - call(["/usr/sbin/postmap", path+"/generated/virtual"], stdout=open(os.devnull, 'wb')) # Update the aliases config file + call(["/usr/bin/newaliases"], stdout=DEVNULL) # Update the aliases config file + call(["/usr/sbin/postmap", path+"/generated/virtual"], stdout=DEVNULL) # Update the aliases config file call(["/usr/sbin/postfix", "reload"]) # force the reloading now for arg in sys.argv: