summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 85a817231..895ec682a 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -157,9 +157,6 @@ global_output_params = (
Str('memberofindirect_hbacrule?',
label='Indirect Member of HBAC rule',
),
- Str('externalhost?',
- label=_('External host'),
- ),
Str('sourcehost',
label=_('Failed source hosts/hostgroups'),
),
@@ -313,6 +310,20 @@ def wait_for_value(ldap, dn, attr, value):
return entry_attrs
+
+def validate_externalhost(ugettext, hostname):
+ try:
+ validate_hostname(hostname, check_fqdn=False, allow_underscore=True)
+ except ValueError, e:
+ return unicode(e)
+
+
+external_host_param = Str('externalhost*', validate_externalhost,
+ label=_('External host'),
+ flags=['no_create', 'no_update', 'no_search'],
+)
+
+
def add_external_pre_callback(membertype, ldap, dn, keys, options):
"""
Pre callback to validate external members.