From ae7cb45ab325697502641c6ec73019cb454b128c Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 17 Sep 2023 11:10:48 -0500 Subject: [PATCH] Remove `bash -c` prefix for `pg_dump` command need to keep the `sudo -u postgres pg_dump ..` part as simple as possible, since must declare `sudoers` allowance for that --- rattail_fabric2/postgresql.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/rattail_fabric2/postgresql.py b/rattail_fabric2/postgresql.py index 19c4591..d524d78 100644 --- a/rattail_fabric2/postgresql.py +++ b/rattail_fabric2/postgresql.py @@ -28,7 +28,6 @@ import os import re from rattail_fabric2 import apt, append, contains, sed, uncomment -from rattail.util import shlex_join def install(c): @@ -224,7 +223,6 @@ def dump_db(c, name, port=None, exclude_tables=None, if skip_raw_file: tmp_name = f'/tmp/{gz_name}' cmd = f'{cmd} | gzip -c > {tmp_name}' - cmd = shlex_join(['bash', '-c', cmd]) c.sudo(cmd, user='postgres') # TODO: should remove this file c.run(f"cp {tmp_name} {gz_name}")