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))