summaryrefslogtreecommitdiffstats
path: root/ipalib/crud.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2011-01-05 10:07:23 -0500
committerAdam Young <ayoung@redhat.com>2011-01-10 12:07:19 -0500
commit1af89d0daa80062b6ae3fc00de3d4fcc10e1129e (patch)
tree5c7add3b932c4c586cb2a6f43a3f9e6e2b4411f3 /ipalib/crud.py
parent75078c0bd493cdb7b34f94598bff327bd09c44f0 (diff)
downloadfreeipa-1af89d0daa80062b6ae3fc00de3d4fcc10e1129e.tar.gz
freeipa-1af89d0daa80062b6ae3fc00de3d4fcc10e1129e.tar.xz
freeipa-1af89d0daa80062b6ae3fc00de3d4fcc10e1129e.zip
Retype (when cloning) Flag parameters to Bool for search commands.
Flag parameters are always autofill by definition, causing unexpected search results. This patch retypes them to Bool for search commands, so that users have to/can enter the desired value manually. Ticket #689 Ticket #701
Diffstat (limited to 'ipalib/crud.py')
-rw-r--r--ipalib/crud.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/ipalib/crud.py b/ipalib/crud.py
index 86e175655..6df3c733d 100644
--- a/ipalib/crud.py
+++ b/ipalib/crud.py
@@ -210,9 +210,15 @@ class Search(Method):
for option in self.obj.params_minus(self.args):
if 'no_search' in option.flags:
continue
- yield option.clone(
- attribute=True, query=True, required=False, autofill=False
- )
+ if isinstance(option, parameters.Flag):
+ yield option.clone_retype(
+ option.name, parameters.Bool,
+ attribute=True, query=True, required=False, autofill=False
+ )
+ else:
+ yield option.clone(
+ attribute=True, query=True, required=False, autofill=False
+ )
if not self.extra_options_first:
for option in super(Search, self).get_options():
yield option