Skip to content

Commit

Permalink
Merge pull request #48258 from nullify005/ldap-tuple-fixes
Browse files Browse the repository at this point in the history
preserve tuples for ldap modification operations
  • Loading branch information
Nicole Thomas authored Jun 22, 2018
2 parents 65d36b0 + f204629 commit 254f8fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions salt/modules/ldap3.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ def add(connect_spec, dn, attributes):

modlist = salt.utils.data.decode(
ldap.modlist.addModlist(attributes),
to_str=True
to_str=True,
preserve_tuples=True
)
try:
l.c.add_s(dn, modlist)
Expand Down Expand Up @@ -512,7 +513,7 @@ def modify(connect_spec, dn, directives):
modlist[idx] = (mod[0], mod[1],
[_format_unicode_password(x) for x in mod[2]])

modlist = salt.utils.data.decode(modlist, to_str=True)
modlist = salt.utils.data.decode(modlist, to_str=True, preserve_tuples=True)
try:
l.c.modify_s(dn, modlist)
except ldap.LDAPError as e:
Expand Down Expand Up @@ -581,7 +582,8 @@ def change(connect_spec, dn, before, after):

modlist = salt.utils.data.decode(
ldap.modlist.modifyModlist(before, after),
to_str=True
to_str=True,
preserve_tuples=True
)
try:
l.c.modify_s(dn, modlist)
Expand Down

0 comments on commit 254f8fc

Please sign in to comment.