From fffae4cc3eb94c073a6ba39d752dec1b79db3abc Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Tue, 12 Oct 2021 13:25:52 -0400 Subject: [PATCH] updated ini port to int, logged server uri, moved exit --- seafile-ldap.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/seafile-ldap.py b/seafile-ldap.py index 6353f63..f2312c9 100644 --- a/seafile-ldap.py +++ b/seafile-ldap.py @@ -40,25 +40,25 @@ cwd = os.path.dirname(os.path.realpath(__file__)) # import the config file logger.debug("Starting to read the ini config.") -logger.debug("Using file {}/config.ini.".format(cwd)) +logger.debug("Using file {0}/config.ini.".format(cwd)) config = configparser.ConfigParser() config.read(cwd + '/config.ini') serverDNS = config['LDAP SERVER']['server'] -serverPort = config['LDAP SERVER']['port'] +serverPort = config['LDAP SERVER'].getint('port') serverSSL = config['LDAP SERVER'].getboolean('ssl') -logger.debug("Server: {}, Server Port: {}, Using SSL: {}".format(serverDNS, serverPort, serverSSL)) +logger.debug("Server: {0}, Server Port: {1}, Using SSL: {2}".format(serverDNS, serverPort, serverSSL)) bindAccount = config['Bind Account']['username'] bindPassword = config['Bind Account']['password'] -logger.debug("Bind Account: {}, Bind Password: ".format(bindAccount)) +logger.debug("Bind Account: {0}, Bind Password: ".format(bindAccount)) logger.debug("Finished reading the ini config.") -exit() - # setup the server server = Server(serverDNS, port=serverPort, use_ssl=serverSSL) +logger.debug("Setup server connection uri: {0}".format(server)) +exit() #Create a connection object, and bind with the given DN and password. try: conn = Connection(server, bindAccount, bindPassword, auto_bind=True)