Handle missing intelmqdump defaults#2703
Open
BharatDeva wants to merge 1 commit into
Open
Conversation
When loading global settings fails in an incomplete setup, intelmqdump falls back to the default log level but still needs an empty defaults mapping for later logging configuration. Reuse that mapping instead of loading the same settings a second time. Add a regression test covering dump listing when global defaults cannot be loaded. Signed-off-by: BharatDeva <278575558+BharatDeva@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2702
Description
intelmqdumpalready handled failures while loading global settings by falling back to the default log level. However, thedefaultsvariable was not initialized in that exception path, so the following logging setup could raise another exception before the tool had a chance to continue.This change uses an empty defaults mapping when global settings cannot be loaded, and reuses the same mapping instead of calling
get_global_settings()a second time immediately afterwards.Tests
I ran the intelmqdump tests under WSL because the module imports Unix
fcntland cannot run on native Windows:The
/opt/intelmq/var/run/permission messages are emitted by the existing controller setup in these tests; they were present while the tests completed successfully.