This commit is contained in:
Olivier 'reivilibre' 2022-11-19 16:35:33 +00:00
parent 41248fe396
commit cc93997230
2 changed files with 8 additions and 12 deletions

View File

@ -39,10 +39,7 @@ def cli():
# The process (if any) that is our LZ4 decompressor. # The process (if any) that is our LZ4 decompressor.
lz4_process = None lz4_process = None
dump_command = [ dump_command = ["pg_dump", database_to_use]
"pg_dump",
database_to_use
]
if host_to_use is not None: if host_to_use is not None:
if use_lz4: if use_lz4:
@ -63,21 +60,19 @@ def cli():
# (rather than lz4 covering it). # (rather than lz4 covering it).
command = [ command = [
"ssh", "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", "bash",
"-o", "-o",
"pipefail", "pipefail",
"-c", "-c",
shlex.quote(" ".join(dump_command)) shlex.quote(" ".join(dump_command)),
] ]
elif user_to_use is not None: elif user_to_use is not None:
current_username = pwd.getpwuid(os.getuid()).pw_name current_username = pwd.getpwuid(os.getuid()).pw_name
if current_username != user_to_use: if current_username != user_to_use:
command = [ command = ["sudo", "-u", user_to_use] + dump_command
"sudo",
"-u",
user_to_use
] + dump_command
else: else:
command = dump_command command = dump_command
else: else:

View File

@ -251,7 +251,8 @@ kind = {{ stdout = "blahblah.txt" }}
seed = 7555 seed = 7555
print(f"seed: {seed}") print(f"seed: {seed}")
rng.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) initial_descriptor, _ = generate_random_dir(rng, src_path, 32, min_files=8)
labellings = generate_labels(initial_descriptor, rng) labellings = generate_labels(initial_descriptor, rng)
save_labelling_rules(labelling_path.joinpath("srca.zst"), labellings) save_labelling_rules(labelling_path.joinpath("srca.zst"), labellings)