diff --git a/seafile-ldap.py b/seafile-ldap.py index c2f817f..8ccc9a2 100644 --- a/seafile-ldap.py +++ b/seafile-ldap.py @@ -71,8 +71,11 @@ cwd = os.path.dirname(os.path.realpath(__file__)) # import the config file logger.debug("Starting to read the ini config.") logger.debug("Using file {0}/config.ini.".format(cwd)) -config = configparser.ConfigParser() -config.read(cwd + '/config.ini') +try: + config = configparser.ConfigParser() + config.read(cwd + '/config.ini') +except ValueError: + logger.critical("Unable to find/read config file. ") serverDNS = config['LDAP SERVER']['server'] serverPort = config['LDAP SERVER'].getint('port')