Move sql file to temp path when restoring postgres db

otherwise postgres may throw an error, if it can't cd to current workdir
This commit is contained in:
Lance Edgar 2023-08-03 10:54:33 -05:00
parent 6479af6a57
commit 94945fbc30

View file

@ -259,7 +259,9 @@ def clone_db(c, name, owner, download, user='rattail', force=False, workdir=None
os.chdir(curdir)
# restore database on target server
restore_db(c, name, '{}.sql.gz'.format(name))
filename = f'{name}.sql.gz'
c.sudo(f'mv {filename} /tmp/')
restore_db(c, name, f'/tmp/{filename}')
def restore_db(c, name, path):