summaryrefslogtreecommitdiffstats
path: root/ipalib/frontend.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-10-11 22:27:57 -0400
committerSimo Sorce <ssorce@redhat.com>2010-10-28 16:06:06 -0400
commit33802ab71262e01704d3342761215ea480354e88 (patch)
treef242d7585a601b51ed576c895b4866c75cbf1a9a /ipalib/frontend.py
parentff636984abfd2b4a8dff329678df9edab4bc3d52 (diff)
downloadfreeipa-33802ab71262e01704d3342761215ea480354e88.tar.gz
freeipa-33802ab71262e01704d3342761215ea480354e88.tar.xz
freeipa-33802ab71262e01704d3342761215ea480354e88.zip
Use context to decide which name to return on RequirementsErrors
When a Requirement fails we throw an exception including the name of the field that is missing. To make the command-line friendlier we have a cli_name defined which may or may not match the LDAP attribute. This can be confusing if you are using ipalib directly because the attribute name missing may not match what is actually required (desc vs description is a good example). If you use the context 'cli' then it will throw exceptions using cli_name. If you use any other context it will use the name of the attribute. ticket 187
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r--ipalib/frontend.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 473e2332e..577c2fcc9 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -656,7 +656,7 @@ class Command(HasParam):
"""
for param in self.params():
value = kw.get(param.name, None)
- param.validate(value)
+ param.validate(value, self.env.context)
def run(self, *args, **options):
"""