Do not break if client section/or OTP creds missing from conf file

This commit is contained in:
ahmadbilalkhalid 2020-01-10 16:39:40 +05:00
commit 00d876aea1
4 changed files with 20 additions and 15 deletions

View file

@ -99,12 +99,10 @@ class Settings(object):
def read_config_file_values(self, config_file):
try:
# Trying to read configuration file
with open(config_file, 'r') as config_file_handle:
with open(config_file) as config_file_handle:
self.config_parser.read_file(config_file_handle)
except FileNotFoundError:
sys.exit(
'Configuration file {} not found!'.format(config_file)
)
sys.exit('Configuration file {} not found!'.format(config_file))
except Exception as err:
logger.exception(err)
sys.exit('Error occurred while reading configuration file')