Project

General

Profile

0001-ctl-fix-all-option-for-wipe-data-command-13813.patch

Serghei Mihai, 01 Nov 2016 03:51 PM

Download (1.5 KB)

View differences:

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(-)
tests/test_ctl.py
81 81
    assert form_2.data_class().count() == 1
82 82

  
83 83
    wipe_cmd = CmdWipeData()
84

  
85
    # check command options
86
    options, args = wipe_cmd.parse_args(['--all'])
87
    assert options.all
88

  
89
    options, args = wipe_cmd.parse_args([form_1.url_name, form_2.url_name])
90
    assert form_1.url_name in args
91
    assert form_2.url_name in args
92

  
84 93
    sub_options_class = collections.namedtuple('Options', ['all'])
85 94
    sub_options = sub_options_class(False)
86 95

  
wcs/ctl/wipe_data.py
24 24

  
25 25
    def __init__(self):
26 26
        Command.__init__(self, [
27
                make_option('--all', metavar='ALL', action='store_false',
27
                make_option('--all', metavar='ALL', action='store_true',
28 28
                            dest='all'),
29 29
                make_option('--vhost', metavar='VHOST', action='store',
30 30
                            dest='vhost'),
31
-