added try for reading config file
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user