Can no longer init sbws due to config error
Created by: pastly
(venv-editable) cranium:simple-bw-scanner mtraudt$ sbws -d /tmp/sbws init
Traceback (most recent call last):
File "/Users/mtraudt/src/simple-bw-scanner/venv-editable/bin/sbws", line 11, in <module>
load_entry_point('sbws', 'console_scripts', 'sbws')()
File "/Users/mtraudt/src/simple-bw-scanner/sbws/sbws.py", line 31, in main
configure_logging(conf)
File "/Users/mtraudt/src/simple-bw-scanner/sbws/util/config.py", line 93, in configure_logging
"('{}',)".format(conf['paths']['log_filepath'])
File "/Users/mtraudt/.pyenv/versions/3.6.5/lib/python3.6/configparser.py", line 1234, in __getitem__
return self._parser.get(self._name, key)
File "/Users/mtraudt/.pyenv/versions/3.6.5/lib/python3.6/configparser.py", line 800, in get
d)
File "/Users/mtraudt/.pyenv/versions/3.6.5/lib/python3.6/configparser.py", line 455, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "/Users/mtraudt/.pyenv/versions/3.6.5/lib/python3.6/configparser.py", line 507, in _interpolate_some
option, section, rawval, ":".join(path)) from None
configparser.InterpolationMissingOptionError: Bad value substitution: option 'log_filepath' in section 'paths' contains an interpolation key 'sbws_home' which is not a valid option name. Raw value: '${sbws_home}/sbws.log'
Most likely sbws_home
isn't set yetat the time configure_logging
is called when initializing sbws for the first time.
Accompanying the fix for this, I'd like to see a test that calls sbws init
so errors like these can be caught in the future.