diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-05-19 15:09:21 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-05-25 16:06:26 +0200 |
commit | 213237c7fe053b43589de4bc64a871861da6db9a (patch) | |
tree | 819e351419710567704fe7adc1add15609025c78 | |
parent | 3eaafe42b52d3c76517946fa4c2c1c120065b9fa (diff) | |
download | freeipa-213237c7fe053b43589de4bc64a871861da6db9a.tar.gz freeipa-213237c7fe053b43589de4bc64a871861da6db9a.tar.xz freeipa-213237c7fe053b43589de4bc64a871861da6db9a.zip |
user: do not assume the preserve flags have value in user_del
https://fedorahosted.org/freeipa/ticket/4739
Reviewed-By: David Kupka <dkupka@redhat.com>
-rw-r--r-- | ipalib/plugins/user.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ipalib/plugins/user.py b/ipalib/plugins/user.py index adcee2c5b..d4e7e04ef 100644 --- a/ipalib/plugins/user.py +++ b/ipalib/plugins/user.py @@ -674,14 +674,15 @@ class user_del(baseuser_del): def forward(self, *keys, **options): if self.api.env.context == 'cli': - if options['no_preserve'] and options['preserve']: + no_preserve = options.pop('no_preserve', False) + preserve = options.pop('preserve', False) + if no_preserve and preserve: raise errors.MutuallyExclusiveError( reason=_("preserve and no-preserve cannot be both set")) - elif options['no_preserve']: + elif no_preserve: options['preserve'] = False - elif not options['preserve']: - del options['preserve'] - del options['no_preserve'] + elif preserve: + options['preserve'] = True return super(user_del, self).forward(*keys, **options) |