diff options
author | Pavel Zuna <pzuna@redhat.com> | 2011-01-05 10:07:23 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-01-10 12:07:19 -0500 |
commit | 1af89d0daa80062b6ae3fc00de3d4fcc10e1129e (patch) | |
tree | 5c7add3b932c4c586cb2a6f43a3f9e6e2b4411f3 /ipalib/parameters.py | |
parent | 75078c0bd493cdb7b34f94598bff327bd09c44f0 (diff) | |
download | freeipa-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/parameters.py')
-rw-r--r-- | ipalib/parameters.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 5c386c324..128c8a463 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -585,9 +585,15 @@ class Param(ReadOnly): """ Return a new `Param` instance similar to this one, but named differently """ + return self.clone_retype(name, self.__class__, **overrides) + + def clone_retype(self, name, klass, **overrides): + """ + Return a new `Param` instance similar to this one, but of a different type + """ kw = dict(self.__clonekw) kw.update(overrides) - return self.__class__(name, *self.rules, **kw) + return klass(name, *self.rules, **kw) def normalize(self, value): """ |