Skip to content

Commit

Permalink
Removed config assertion to enable config-file less config
Browse files Browse the repository at this point in the history
The config lookup works by first checking for the <SECTION>_<VAR> env
var and then looking for the specified <var> in the [<section>] of the
config file. Checking for a specific section in the configuration then
will only work if there is a configuration file, since sections are not
a defined concept in the environment. The test is also unnecesary since
the following var lookup will fail anyway if it's not present.
  • Loading branch information
viklund committed Nov 8, 2019
1 parent 19899db commit d066b95
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lega/utils/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ def get_connection(domain, blocking=True):
heartbeat values are read from the CONF argument.
So are the SSL options.
"""
assert domain in CONF.sections(), "Section not found in config file"

LOG.info(f'Getting a connection to {domain}')
params = CONF.get_value(domain, 'connection', raw=True)
LOG.debug(f"Initializing a connection to: {params}")
Expand Down

0 comments on commit d066b95

Please sign in to comment.