summaryrefslogtreecommitdiffstats
path: root/ipalib/frontend.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-22 09:58:35 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-03 15:29:00 -0500
commit6aadeb9aea60165d9c68b348dae4df456b00dfc4 (patch)
tree93f957952dd32d52eef0197d533df601b7804925 /ipalib/frontend.py
parent529819b02b1c6e78b85481b417ae896b7237f0e2 (diff)
downloadfreeipa-6aadeb9aea60165d9c68b348dae4df456b00dfc4.tar.gz
freeipa-6aadeb9aea60165d9c68b348dae4df456b00dfc4.tar.xz
freeipa-6aadeb9aea60165d9c68b348dae4df456b00dfc4.zip
Added Object.params_minus() method; various small tweaks
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r--ipalib/frontend.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 640b01f92..67f0a89c2 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -27,7 +27,7 @@ import plugable
from plugable import lock, check_name
import errors
from errors import check_type, check_isinstance, raise_TypeError
-from parameters import create_param, Param, Str, Flag
+from parameters import create_param, Param, Str, Flag, Password
from util import make_repr
from errors2 import ZeroArgumentError, MaxArgumentError, OverlapError
@@ -102,6 +102,7 @@ class Command(plugable.Plugin):
params.update(self.get_default(**params))
self.validate(**params)
(args, options) = self.params_2_args_options(**params)
+ self.debug(make_repr(self.name, *args, **options))
result = self.run(*args, **options)
self.debug('%s result: %r', self.name, result)
return result
@@ -447,6 +448,18 @@ class Object(plugable.Plugin):
if 'Backend' in self.api and self.backend_name in self.api.Backend:
self.backend = self.api.Backend[self.backend_name]
+ def params_minus(self, *names):
+ """
+ Yield all Param whose name is not in ``names``.
+ """
+ if len(names) == 1 and not isinstance(names[0], (Param, str)):
+ names = names[0]
+ minus = frozenset(names)
+ for param in self.params():
+ if param.name in minus or param in minus:
+ continue
+ yield param
+
def get_dn(self, primary_key):
"""
Construct an LDAP DN from a primary_key.