Do not crash on bad LDAP data when formatting decode error message.

https://fedorahosted.org/freeipa/ticket/3488
This commit is contained in:
Jan Cholasta 2013-12-10 11:54:25 +01:00 committed by Petr Viktorin
parent d6c3d3f57a
commit c86d9f33c9

View File

@ -422,7 +422,7 @@ class IPASimpleLDAPObject(object):
try:
return target_type(val)
except Exception, e:
msg = 'unable to convert the attribute "%s" value "%s" to type %s' % (attr, val, target_type)
msg = 'unable to convert the attribute %r value %r to type %s' % (attr, val, target_type)
self.log.error(msg)
raise ValueError(msg)
elif isinstance(val, list):