Skip to content

Commit 3799ae9

Browse files
committed
fix initialization of option_validator
When using option_validator to validate config.ini entries for detectors or extensions, the list of validators was not reset when the tracker was re-opened. This led to the second command run in roundup-admin crashing when the main config.ini file was read. On second tracker open/read option_validator lists an extension/detector option that doesn't exist in the main config.ini. When it tried to validate, the missing option caused a crash. This only happens if a validator is added in an extension/detector. If the only validators ae ones for the main config.ini everything works fine across multiple tracker opens.
1 parent c70c50d commit 3799ae9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ Fixed:
8181
- upgrade from jquery-3.5.1 to jquery-3.6.3. Update user.help.html
8282
to new version. (John Rouillard)
8383
- Dockerfile scanned with hadolint. Fixed multiple issues. (John Rouillard)
84+
- fix crash due to invalid initialization/reset of configuration.py
85+
option_validators. Crashed roundup-admin on second command if an
86+
option_validator was added by a detector or extension. (John Rouillard)
8487

8588
Features:
8689

roundup/configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ class Config:
17561756

17571757
# List of option names that need additional validation after
17581758
# all options are loaded.
1759-
option_validators = []
1759+
option_validators = None
17601760

17611761
def __init__(self, config_path=None, layout=None, settings=None):
17621762
"""Initialize confing instance
@@ -1782,6 +1782,7 @@ def __init__(self, config_path=None, layout=None, settings=None):
17821782
self.section_descriptions = {}
17831783
self.section_options = {}
17841784
self.options = {}
1785+
self.option_validators = []
17851786
# add options from the layout structure
17861787
if layout:
17871788
for section in layout:

0 commit comments

Comments
 (0)