Redo boolean value encoding.

Move the code for encoding boolean values to LDAP boolean syntax from the
Parameter class to the Encoder class, where the rest of LDAP encoding takes
place. Remove encoding code from the Parameter class altogether, as all LDAP
encoding should be done in the Encoder class.
This commit is contained in:
Jan Cholasta
2012-05-04 10:34:00 -04:00
committed by Martin Kosek
parent abef5e8c02
commit d9d1967989
7 changed files with 10 additions and 70 deletions

View File

@@ -933,12 +933,6 @@ last, after all sets and adds."""),
raise errors.ValidationError(name=attr, error=err.error)
except errors.ConversionError, err:
raise errors.ConversionError(name=attr, error=err.error)
# FIXME: We use `force` when encoding because we know this is
# an attribute, even if it does not have the `attribute` flag
# set. This happens with no_update attributes, which are
# not cloned to Update commands. This cloning is where the flag
# gets set.
value = param.encode(value, force=True)
entry_attrs[attr] = value
else:
# unknown attribute: remove duplicite and invalid values