From 47c27eaba51334b10bb45296e407b0f42ed999bd Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 8 Oct 2020 13:58:55 -0500 Subject: [PATCH] Don't use sudo for parts of `postgresql.restore_db()` since apparently that is a problem --- rattail_fabric2/postgresql.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rattail_fabric2/postgresql.py b/rattail_fabric2/postgresql.py index 58340f1..2fa444b 100644 --- a/rattail_fabric2/postgresql.py +++ b/rattail_fabric2/postgresql.py @@ -211,8 +211,8 @@ def restore_db(c, name, path): if not path.endswith('.sql.gz'): raise ValueError("Path to dump file must end in `.sql.gz`") - c.sudo('gunzip --force {}'.format(path)) + c.run('gunzip --force {}'.format(path)) sql_path = path[:-3] c.sudo('psql --echo-errors --file={} {}'.format(sql_path, name), user='postgres') - c.sudo('rm {}'.format(sql_path)) + c.run('rm {}'.format(sql_path))