Don't use sudo for parts of postgresql.restore_db()

since apparently that is a problem
This commit is contained in:
Lance Edgar 2020-10-08 13:58:55 -05:00
parent caf94ac65a
commit 47c27eaba5

View file

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