From 18bc2fe78b9033e2d934263e69d551da62bf30c8 Mon Sep 17 00:00:00 2001 From: Dario Ernst Date: Thu, 3 Oct 2019 08:31:00 +0000 Subject: [PATCH] Use more readable forms of makedirs and chmod --- core/dovecot/start.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/dovecot/start.py b/core/dovecot/start.py index f782eaf4..3a85f64b 100755 --- a/core/dovecot/start.py +++ b/core/dovecot/start.py @@ -33,14 +33,11 @@ if os.environ["WEBMAIL"] != "none": for dovecot_file in glob.glob("/conf/*.conf"): conf.jinja(dovecot_file, os.environ, os.path.join("/etc/dovecot", os.path.basename(dovecot_file))) -try: - os.mkdir("/conf/bin") -except FileExistsError: - pass +os.makedirs("/conf/bin", exist_ok=True) for script_file in glob.glob("/conf/*.script"): out_file = os.path.join("/conf/bin/", os.path.basename(script_file).replace('.script','')) conf.jinja(script_file, os.environ, out_file) - os.chmod(out_file, stat.S_IRUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + os.chmod(out_file, 0555) # Run Podop, then postfix multiprocessing.Process(target=start_podop).start()