Skip to content

Commit

Permalink
fix python3 encoding for ldap attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
wpoely86 committed Aug 10, 2023
1 parent 4ebaa51 commit f56e5df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/vsc/ldap/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ def __modify(self, current, dn, attributes):
key, EMPTY_GECOS_DURING_MODIFY, dn)
current_[key] = EMPTY_GECOS_DURING_MODIFY # hack to allow replacing empty strings

attributes = {key:[v.encode("utf-8") if type(v) == str else v for v in values]
for key, values in attributes.items()}
if isinstance(attributes[key], list):
attributes[key] = [v.encode("utf-8") if isinstance(v, str) else v for v in values]

# [(ldap.MOD_REPLACE, k, v) for (k,v) in attributes.items()]
modification_attributes = ldap.modlist.modifyModlist(current_, attributes)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
from vsc.install.shared_setup import ag, kh, sdw, wdp, jt

PACKAGE = {
'setup_requires': ['vsc-install >= 0.15.2'],
'setup_requires': ['vsc-install >= 0.18.8'],
'install_requires': [
'vsc-base >= 3.0.2',
'vsc-utils >= 2.0.0',
'future >= 0.16.0',
'python-ldap',
],
'version': '2.2.1',
'version': '2.2.2'
'author': [ag, kh, sdw, wdp, jt],
'maintainer': [ag],
}
Expand Down

0 comments on commit f56e5df

Please sign in to comment.