[sysadmin-bin] ldap.open() is deprecated. Make also sure we always connect via a secure port



commit f442ce64d9f33d296cd048c506d1fa113547e229
Author: Andrea Veri <averi redhat com>
Date:   Mon Oct 1 16:16:06 2018 +0200

    ldap.open() is deprecated. Make also sure we always connect via a secure port

 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 9a50d30..f00af83 100755
--- a/gnome_ldap_utils.py
+++ b/gnome_ldap_utils.py
@@ -13,8 +13,8 @@ class Gnome_ldap_utils:
         self.LDAP_HOST = LDAP_HOST
 
         try:
-            self.conn = ldap.open(self.LDAP_HOST)
-            self.conn.simple_bind(self.LDAP_USER, self.LDAP_PASSWORD)
+            self.conn = ldap.initialize("ldaps://%s:636" % self.LDAP_HOST)
+            self.conn.simple_bind_s(self.LDAP_USER, self.LDAP_PASSWORD)
         except ldap.LDAPError, e:
             print >>sys.stderr, e
             sys.exit(1)


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