Add a conditional around the config file parsing attempt
This commit is contained in:
parent
b6fa8e6632
commit
9f86ea1f30
|
@ -30,13 +30,14 @@ class Config:
|
|||
logging.debug('Parsing config')
|
||||
parsed = {}
|
||||
|
||||
try:
|
||||
with open(configfile, 'r') as file:
|
||||
parsed = yaml.safe_load(file.read())
|
||||
except FileNotFoundError as error:
|
||||
logging.warning('No config file found (%s)', error.filename)
|
||||
except TypeError:
|
||||
logging.warning('No config file provided.')
|
||||
if configfile is not None:
|
||||
try:
|
||||
with open(configfile, 'r') as file:
|
||||
parsed = yaml.safe_load(file.read())
|
||||
except FileNotFoundError as error:
|
||||
logging.warning('No config file found (%s)', error.filename)
|
||||
except TypeError:
|
||||
logging.warning('No config file provided.')
|
||||
|
||||
# Iterate over the config defaults and check for environment variable
|
||||
# overrides, then check for any items in the config, otherwise
|
||||
|
|
Loading…
Reference in a new issue