1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-06 16:07:22 +01:00

Fixed UP015 (redundant-open-modes): Unnecessary open mode parameters

This commit is contained in:
Teal Dulcet
2023-12-22 07:08:56 -08:00
committed by Joshua Tauberer
parent 0ee64f2fe8
commit cb922ec286
9 changed files with 19 additions and 19 deletions

View File

@@ -63,7 +63,7 @@ def get_web_domains_with_root_overrides(env):
root_overrides = { }
nginx_conf_custom_fn = os.path.join(env["STORAGE_ROOT"], "www/custom.yaml")
if os.path.exists(nginx_conf_custom_fn):
with open(nginx_conf_custom_fn, 'r') as f:
with open(nginx_conf_custom_fn) as f:
custom_settings = rtyaml.load(f)
for domain, settings in custom_settings.items():
for type, value in [('redirect', settings.get('redirects', {}).get('/')),
@@ -78,7 +78,7 @@ def do_web_update(env):
# Helper for reading config files and templates
def read_conf(conf_fn):
with open(os.path.join(os.path.dirname(__file__), "../conf", conf_fn), "r") as f:
with open(os.path.join(os.path.dirname(__file__), "../conf", conf_fn)) as f:
return f.read()
# Build an nginx configuration file.
@@ -156,7 +156,7 @@ def make_domain_config(domain, templates, ssl_certificates, env):
hsts = "yes"
nginx_conf_custom_fn = os.path.join(env["STORAGE_ROOT"], "www/custom.yaml")
if os.path.exists(nginx_conf_custom_fn):
with open(nginx_conf_custom_fn, 'r') as f:
with open(nginx_conf_custom_fn) as f:
yaml = rtyaml.load(f)
if domain in yaml:
yaml = yaml[domain]