From 07048d3e26ea62b4b156b8ff8ffdc538e6689909 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 7 Aug 2014 10:27:02 +0200 Subject: [PATCH] Leave possibilty to not provide bind DN and Password to connect to LDAP servers --- check_syncrepl_extended | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/check_syncrepl_extended b/check_syncrepl_extended index 043dd1f..2909e57 100755 --- a/check_syncrepl_extended +++ b/check_syncrepl_extended @@ -145,10 +145,6 @@ if not options.provider or not options.consumer: print "You must provide provider and customer URI" sys.exit(1) -if not options.dn or not options.pwd: - print "You must provide DN and password to connect to LDAP servers" - sys.exit(1) - if not options.basedn: print "You must provide base DN of connection to LDAP servers" sys.exit(1) @@ -194,7 +190,7 @@ class LdapServer(object): try: con = ldap.initialize(self.uri) con.protocol_version = ldap.VERSION3 - if self.dn != '': + if self.dn: con.simple_bind_s(self.dn,self.pwd) self.con = con return True