Fixed RUF005 (collection-literal-concatenation)

This commit is contained in:
Teal Dulcet 2023-12-23 05:20:45 -08:00 committed by Joshua Tauberer
parent 0e9193651d
commit e466b9bb53
5 changed files with 14 additions and 14 deletions

View File

@ -59,7 +59,7 @@ def backup_status(env):
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
"--gpg-options", "'--cipher-algo=AES256'", "--gpg-options", "'--cipher-algo=AES256'",
"--log-fd", "1", "--log-fd", "1",
] + get_duplicity_additional_args(env) + [ *get_duplicity_additional_args(env),
get_duplicity_target_url(config) get_duplicity_target_url(config)
], ],
get_duplicity_env_vars(env), get_duplicity_env_vars(env),
@ -322,8 +322,8 @@ def perform_backup(full_backup):
"--exclude", backup_root, "--exclude", backup_root,
"--volsize", "250", "--volsize", "250",
"--gpg-options", "'--cipher-algo=AES256'", "--gpg-options", "'--cipher-algo=AES256'",
"--allow-source-mismatch" "--allow-source-mismatch",
] + get_duplicity_additional_args(env) + [ *get_duplicity_additional_args(env),
env["STORAGE_ROOT"], env["STORAGE_ROOT"],
get_duplicity_target_url(config), get_duplicity_target_url(config),
], ],
@ -344,7 +344,7 @@ def perform_backup(full_backup):
"--verbosity", "error", "--verbosity", "error",
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
"--force", "--force",
] + get_duplicity_additional_args(env) + [ *get_duplicity_additional_args(env),
get_duplicity_target_url(config) get_duplicity_target_url(config)
], ],
get_duplicity_env_vars(env)) get_duplicity_env_vars(env))
@ -360,7 +360,7 @@ def perform_backup(full_backup):
"--verbosity", "error", "--verbosity", "error",
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
"--force", "--force",
] + get_duplicity_additional_args(env) + [ *get_duplicity_additional_args(env),
get_duplicity_target_url(config) get_duplicity_target_url(config)
], ],
get_duplicity_env_vars(env)) get_duplicity_env_vars(env))
@ -399,7 +399,7 @@ def run_duplicity_verification():
"--compare-data", "--compare-data",
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
"--exclude", backup_root, "--exclude", backup_root,
] + get_duplicity_additional_args(env) + [ *get_duplicity_additional_args(env),
get_duplicity_target_url(config), get_duplicity_target_url(config),
env["STORAGE_ROOT"], env["STORAGE_ROOT"],
], get_duplicity_env_vars(env)) ], get_duplicity_env_vars(env))
@ -412,9 +412,9 @@ def run_duplicity_restore(args):
"/usr/bin/duplicity", "/usr/bin/duplicity",
"restore", "restore",
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
] + get_duplicity_additional_args(env) + [ *get_duplicity_additional_args(env),
get_duplicity_target_url(config) get_duplicity_target_url(config),
] + args, *args],
get_duplicity_env_vars(env)) get_duplicity_env_vars(env))
def print_duplicity_command(): def print_duplicity_command():
@ -426,7 +426,7 @@ def print_duplicity_command():
print(f"export {k}={shlex.quote(v)}") print(f"export {k}={shlex.quote(v)}")
print("duplicity", "{command}", shlex.join([ print("duplicity", "{command}", shlex.join([
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
] + get_duplicity_additional_args(env) + [ *get_duplicity_additional_args(env),
get_duplicity_target_url(config) get_duplicity_target_url(config)
])) ]))

View File

@ -518,7 +518,7 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
secondary_ns = custom_secondary_ns or ["ns2." + env['PRIMARY_HOSTNAME']] secondary_ns = custom_secondary_ns or ["ns2." + env['PRIMARY_HOSTNAME']]
existing_ns = query_dns(domain, "NS") existing_ns = query_dns(domain, "NS")
correct_ns = "; ".join(sorted(["ns1." + env['PRIMARY_HOSTNAME']] + secondary_ns)) correct_ns = "; ".join(sorted(["ns1." + env["PRIMARY_HOSTNAME"], *secondary_ns]))
ip = query_dns(domain, "A") ip = query_dns(domain, "A")
probably_external_dns = False probably_external_dns = False

View File

@ -215,7 +215,7 @@ def make_domain_config(domain, templates, ssl_certificates, env):
# Combine the pieces. Iteratively place each template into the "# ADDITIONAL DIRECTIVES HERE" placeholder # Combine the pieces. Iteratively place each template into the "# ADDITIONAL DIRECTIVES HERE" placeholder
# of the previous template. # of the previous template.
nginx_conf = "# ADDITIONAL DIRECTIVES HERE\n" nginx_conf = "# ADDITIONAL DIRECTIVES HERE\n"
for t in templates + [nginx_conf_extra]: for t in [*templates, nginx_conf_extra]:
nginx_conf = re.sub("[ \t]*# ADDITIONAL DIRECTIVES HERE *\n", t, nginx_conf) nginx_conf = re.sub("[ \t]*# ADDITIONAL DIRECTIVES HERE *\n", t, nginx_conf)
# Replace substitution strings in the template & return. # Replace substitution strings in the template & return.

View File

@ -181,7 +181,7 @@ def run_test(testfunc, args, count, within_seconds, parallel):
# Distribute the requests across the pool. # Distribute the requests across the pool.
asyncresults = [] asyncresults = []
for i in range(count): for i in range(count):
ar = p.apply_async(testfunc_runner, [i, testfunc] + list(args)) ar = p.apply_async(testfunc_runner, [i, testfunc, *list(args)])
asyncresults.append(ar) asyncresults.append(ar)
# Wait for all runs to finish. # Wait for all runs to finish.

View File

@ -88,7 +88,7 @@ def sslyze(opts, port, ok_ciphers):
try: try:
# Execute SSLyze. # Execute SSLyze.
out = subprocess.check_output([SSLYZE] + common_opts + opts + [connection_string]) out = subprocess.check_output([SSLYZE, *common_opts, *opts, connection_string])
out = out.decode("utf8") out = out.decode("utf8")
# Trim output to make better for storing in git. # Trim output to make better for storing in git.