[mail-server] Uses built-in subprocess.DEVNULL instead of opening dev/null
This commit is contained in:
parent
0e7aba6459
commit
d8499579e3
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -9,7 +9,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||||
import requests
|
import requests
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
from subprocess import call
|
from subprocess import call, DEVNULL
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ def generate(api_client):
|
||||||
fichier.write(virtuals_rendered)
|
fichier.write(virtuals_rendered)
|
||||||
fichier.close()
|
fichier.close()
|
||||||
|
|
||||||
call(["/usr/bin/newaliases"], 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=open(os.devnull, 'wb')) # 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
|
call(["/usr/sbin/postfix", "reload"]) # force the reloading now
|
||||||
|
|
||||||
for arg in sys.argv:
|
for arg in sys.argv:
|
||||||
|
|
Loading…
Reference in a new issue