diff options
Diffstat (limited to 'ipalib/util.py')
-rw-r--r-- | ipalib/util.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py index a79f41cc..659e178d 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -31,6 +31,7 @@ from weakref import WeakKeyDictionary from ipalib import errors from ipalib.text import _ +from ipalib.dn import DN, RDN from ipapython import dnsclient from ipapython.ipautil import decode_ssh_pubkey @@ -484,3 +485,17 @@ def gen_dns_update_policy(realm, rrtypes=('A', 'AAAA', 'SSHFP')): policy += ";" return policy + +def validate_rdn_param(ugettext, value): + try: + rdn = RDN(value) + except Exception, e: + return str(e) + return None + +def validate_dn_param(ugettext, value): + try: + rdn = DN(value) + except Exception, e: + return str(e) + return None |