From cc9399723031fe60c7d272a827715fbfaf2cb7c8 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sat, 19 Nov 2022 16:35:33 +0000 Subject: [PATCH] Linting --- .../datman_helper_postgres/backup.py | 17 ++++++----------- .../datmantests/test_backup_and_extract.py | 3 ++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/datman-helper-postgres/datman_helper_postgres/backup.py b/datman-helper-postgres/datman_helper_postgres/backup.py index d6478ce..3f9f031 100644 --- a/datman-helper-postgres/datman_helper_postgres/backup.py +++ b/datman-helper-postgres/datman_helper_postgres/backup.py @@ -39,10 +39,7 @@ def cli(): # The process (if any) that is our LZ4 decompressor. lz4_process = None - dump_command = [ - "pg_dump", - database_to_use - ] + dump_command = ["pg_dump", database_to_use] if host_to_use is not None: if use_lz4: @@ -63,21 +60,19 @@ def cli(): # (rather than lz4 covering it). command = [ "ssh", - f"{user_to_use}@{host_to_use}" if user_to_use is not None else f"{host_to_use}", + f"{user_to_use}@{host_to_use}" + if user_to_use is not None + else f"{host_to_use}", "bash", "-o", "pipefail", "-c", - shlex.quote(" ".join(dump_command)) + shlex.quote(" ".join(dump_command)), ] elif user_to_use is not None: current_username = pwd.getpwuid(os.getuid()).pw_name if current_username != user_to_use: - command = [ - "sudo", - "-u", - user_to_use - ] + dump_command + command = ["sudo", "-u", user_to_use] + dump_command else: command = dump_command else: diff --git a/testsuite/datmantests/test_backup_and_extract.py b/testsuite/datmantests/test_backup_and_extract.py index 52c443d..cb194c4 100644 --- a/testsuite/datmantests/test_backup_and_extract.py +++ b/testsuite/datmantests/test_backup_and_extract.py @@ -251,7 +251,8 @@ kind = {{ stdout = "blahblah.txt" }} seed = 7555 print(f"seed: {seed}") rng.seed(seed) - # min_files is 8 because we need enough files to use each label for this test to succeed. + # min_files is 8 because we need enough files to use each label for this + # test to succeed. initial_descriptor, _ = generate_random_dir(rng, src_path, 32, min_files=8) labellings = generate_labels(initial_descriptor, rng) save_labelling_rules(labelling_path.joinpath("srca.zst"), labellings)