diff --git a/seafile-ldap.py b/seafile-ldap.py index 79a192e..f5f714d 100644 --- a/seafile-ldap.py +++ b/seafile-ldap.py @@ -72,11 +72,12 @@ configPath = os.path.join(cwd, 'config.ini') # import the config file logger.debug("Starting to read the ini config.") logger.debug("Using file {0}.".format(configPath)) -try: +if os.path.exists(configPath): config = configparser.ConfigParser() config.read(cwd + '/config.ini') -except ValueError: - logger.critical("Unable to find/read config file. ") +else: + logger.critical("Unable to find/read config file. Please ensure the config.ini is in the same directory as this script and readable.") + exit(1) serverDNS = config['LDAP SERVER']['server'] serverPort = config['LDAP SERVER'].getint('port')