Don't fail when adding default objectclasses using config-mod

The config plugin was adding together a list and a tuple, then
converting to a set.
Replace the operation with a set union.

Regression test included.

https://fedorahosted.org/freeipa/ticket/2706
This commit is contained in:
Petr Viktorin
2012-05-02 12:36:15 -04:00
committed by Martin Kosek
parent d9d1967989
commit c02fcf5d34
2 changed files with 57 additions and 2 deletions

View File

@@ -229,8 +229,8 @@ class config_mod(LDAPUpdate):
if not entry_attrs[attr]:
raise errors.ValidationError(name=attr,
error=_('May not be empty'))
objectclasses = list(set(entry_attrs[attr] \
+ self.api.Object[obj].possible_objectclasses))
objectclasses = list(set(entry_attrs[attr]).union(
self.api.Object[obj].possible_objectclasses))
new_allowed_attrs = ldap.get_allowed_attributes(objectclasses,
raise_on_unknown=True)
checked_attrs = self.api.Object[obj].default_attributes