Ensure that the import/export feature should work with SSH Tunnel. Fixes #5739

This commit is contained in:
Pradip Parkale
2020-09-22 09:40:59 +05:30
committed by Akshay Joshi
parent ed3c692b1f
commit 1ee9cddceb
2 changed files with 7 additions and 2 deletions

View File

@@ -342,8 +342,12 @@ def create_import_export_job(sid):
manager.export_password_env(p.id)
env = dict()
env['PGHOST'] = server.host
env['PGPORT'] = str(server.port)
env['PGHOST'] = \
manager.local_bind_host if manager.use_ssh_tunnel else server.host
env['PGPORT'] = \
str(manager.local_bind_port) if manager.use_ssh_tunnel else str(
server.port)
env['PGUSER'] = server.username
env['PGDATABASE'] = data['database']
p.set_env_variables(server, env=env)