From bb5788fc7e1278d7d342e403248f7ccc58dfd6ed Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 15 Aug 2012 16:30:24 -0400 Subject: Raise proper exception when given a bad DN attribute. --- ipalib/plugins/baseldap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ipalib/plugins/baseldap.py') diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index e05f59ff..011d6262 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -809,7 +809,10 @@ last, after all sets and adds."""), value = None if ldap.has_dn_syntax(attr): - value = DN(value) + try: + value = DN(value) + except ValueError: + raise errors.InvalidSyntax(attr=attr) if attr in newdict: if type(value) in (tuple,): -- cgit