[sysadmin-bin] We need a bytestring passed there



commit 685282880e625229b053cdc1ef4021f41b39c1f2
Author: Andrea Veri <averi redhat com>
Date:   Mon Nov 30 14:42:09 2020 +0100

    We need a bytestring passed there

 gnome_ldap_utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnome_ldap_utils.py b/gnome_ldap_utils.py
index 5941ab2..d890feb 100755
--- a/gnome_ldap_utils.py
+++ b/gnome_ldap_utils.py
@@ -104,10 +104,10 @@ class Gnome_ldap_utils:
         import ldap
 
         if add and not update:
-            update_comment = [(ldap.MOD_ADD, 'description', comment)]
+            update_comment = [(ldap.MOD_ADD, 'description', comment.encode())]
             self.conn.modify_s('uid=%s,%s' % (userid, self.LDAP_USER_BASE), update_comment)
         elif update and not add:
-            update_comment = [(ldap.MOD_REPLACE, 'description', comment)]
+            update_comment = [(ldap.MOD_REPLACE, 'description', comment.encode())]
             self.conn.modify_s('uid=%s,%s' % (userid, self.LDAP_USER_BASE), update_comment)
         else:
             sys.exit(1)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]