public inbox for [email protected]
help / color / mirror / Atom feedFrom: Khushboo Vashi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][Patch]: Fixed RM #3362 - Database restore utility does not honour restore options for sections
Date: Mon, 2 Jul 2018 10:39:16 +0530
Message-ID: <CAFOhELc9Vxw9ypkFYzY1drtQhhhS4mXrP3o9u7OwGQjeX9w-ew@mail.gmail.com> (raw)
Hi,
Please find the attached patch to fix RM #3362 : Database restore utility
does not honour restore options for sections.
Thanks,
Khushboo
Attachments:
[text/x-patch] RM_3363.patch (3.6K, 3-RM_3363.patch)
download | inline diff:
diff --git a/web/pgadmin/tools/restore/__init__.py b/web/pgadmin/tools/restore/__init__.py
index 1e54985..81e480a 100644
--- a/web/pgadmin/tools/restore/__init__.py
+++ b/web/pgadmin/tools/restore/__init__.py
@@ -299,13 +299,13 @@ def create_restore_job(sid):
if data['format'] == 'directory':
args.extend(['--format=d'])
- set_value('pre_data', '--section=pre-data', False)
- set_value('data', '--section=data', False)
- set_value('post_data', '--section=post-data', False)
+ set_param('pre_data', '--section=pre-data')
+ set_param('data', '--section=data')
+ set_param('post_data', '--section=post-data')
if not set_param('only_data', '--data-only'):
set_param('dns_owner', '--no-owner')
- set_param('dns_privilege ', '--no-privileges')
+ set_param('dns_privilege', '--no-privileges')
set_param('dns_tablespace', '--no-tablespaces')
if not set_param('only_schema', '--schema-only'):
@@ -314,8 +314,8 @@ def create_restore_job(sid):
set_param('include_create_database', '--create')
set_param('clean', '--clean')
set_param('single_transaction', '--single-transaction')
- set_param('no_data_fail_table ', '--no-data-for-failed-tables')
- set_param('use_set_session_auth ', '--use-set-session-authorization')
+ set_param('no_data_fail_table', '--no-data-for-failed-tables')
+ set_param('use_set_session_auth', '--use-set-session-authorization')
set_param('exit_on_error', '--exit-on-error')
set_value('no_of_jobs', '--jobs', True)
diff --git a/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py b/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py
index 223d516..23a1cf0 100644
--- a/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py
+++ b/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py
@@ -104,8 +104,9 @@ class RestoreCreateJobTest(BaseTestGenerator):
only_schema=True
),
url='/restore/job/{0}',
- # Please include sections data here, right now this is a bug
- expected_cmd_opts=['--verbose', '--jobs', '2'],
+ expected_cmd_opts=['--verbose', '--jobs', '2',
+ '--section=pre-data', '--section=data',
+ '--section=post-data'],
not_expected_cmd_opts=[],
# Below options should be enabled once we fix the issue #3368
# not_expected_cmd_opts=['--data-only', '--schema-only'],
@@ -167,9 +168,9 @@ class RestoreCreateJobTest(BaseTestGenerator):
only_data=False
),
url='/restore/job/{0}',
- # Add '--no-privileges' to the expected_cmd once #3363 fixed
expected_cmd_opts=['--no-owner',
- '--no-tablespaces'],
+ '--no-tablespaces',
+ '--no-privileges'],
not_expected_cmd_opts=[],
expected_exit_code=[0, None]
)),
@@ -224,9 +225,8 @@ class RestoreCreateJobTest(BaseTestGenerator):
only_schema=False
),
url='/restore/job/{0}',
- # Add '--no-data-for-failed-tables' into
- # expected_cmd_opts once #3363 fixed
- expected_cmd_opts=['--disable-triggers'],
+ expected_cmd_opts=['--disable-triggers',
+ '--no-data-for-failed-tables'],
not_expected_cmd_opts=[],
expected_exit_code=[0, None]
)),
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin][Patch]: Fixed RM #3362 - Database restore utility does not honour restore options for sections
In-Reply-To: <CAFOhELc9Vxw9ypkFYzY1drtQhhhS4mXrP3o9u7OwGQjeX9w-ew@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox