From e005918260f13bf33c60a8d1fd310bdbb8c7709d Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Mon, 31 Oct 2016 14:10:27 +0100 Subject: [PATCH] ctl: fix 'all' option for wipe-data command (#13813) --- tests/test_ctl.py | 9 +++++++++ wcs/ctl/wipe_data.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_ctl.py b/tests/test_ctl.py index a3eb9ec..b32d628 100644 --- a/tests/test_ctl.py +++ b/tests/test_ctl.py @@ -81,6 +81,15 @@ def test_wipe_formdata(pub): assert form_2.data_class().count() == 1 wipe_cmd = CmdWipeData() + + # check command options + options, args = wipe_cmd.parse_args(['--all']) + assert options.all + + options, args = wipe_cmd.parse_args([form_1.url_name, form_2.url_name]) + assert form_1.url_name in args + assert form_2.url_name in args + sub_options_class = collections.namedtuple('Options', ['all']) sub_options = sub_options_class(False) diff --git a/wcs/ctl/wipe_data.py b/wcs/ctl/wipe_data.py index 8a5f61c..8cdb0ad 100644 --- a/wcs/ctl/wipe_data.py +++ b/wcs/ctl/wipe_data.py @@ -24,7 +24,7 @@ class CmdWipeData(Command): def __init__(self): Command.__init__(self, [ - make_option('--all', metavar='ALL', action='store_false', + make_option('--all', metavar='ALL', action='store_true', dest='all'), make_option('--vhost', metavar='VHOST', action='store', dest='vhost'), -- 2.10.2