Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix os.system parameters templating #16

Open
wants to merge 1 commit into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Fix os.system parameters templating

  • Loading branch information...
Maksim Glyantsev
Maksim Glyantsev committed Dec 5, 2018
commit ef582405cce90959c751157414e3fadab183bef5
@@ -113,8 +113,7 @@ def _setup_source(conn, pg_pass):
pg_dumpall_schema = "%s/pg_dumpall_schema_%s.sql" % (get_tmp_folder(), uuid.uuid4().hex)
output_cli_message("Dump globals and schema of all databases")
pg_dumpall_schema_result = \
os.system('sh -c "PGPASSFILE=%(pgpass)s pg_dumpall -U %(user)s -h %(host)s -p%(port)s -s -f %(fname)s ' +
'--if-exists -c"' %
os.system('sh -c "PGPASSFILE=%(pgpass)s pg_dumpall -U %(user)s -h %(host)s -p%(port)s -s -f %(fname)s --if-exists -c"' %
merge_two_dicts(
get_connection_params('Source'),
{"fname": pg_dumpall_schema, "pgpass": pg_pass}
@@ -160,8 +159,7 @@ def _setup_destination(conn, pg_pass, source_setup_results):
if 'pg_dumpall' in source_setup_results:
restore_schema_result = \
os.system(
'sh -c "PGPASSFILE=%(pgpass)s psql -U %(user)s -h %(host)s -p%(port)s -f %(fname)s -d postgres ' +
'>/dev/null 2>&1"'
'sh -c "PGPASSFILE=%(pgpass)s psql -U %(user)s -h %(host)s -p%(port)s -f %(fname)s -d postgres >/dev/null 2>&1"'
% merge_two_dicts(
get_connection_params('Destination'),
{"fname": source_setup_results['pg_dumpall'], "pgpass": pg_pass}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.