Settingsloader: Fail on Error#633
Conversation
480e167 to
2ef0403
Compare
|
It has been some time since we had any activity on this project :-) So: Before I start wrestling the rest of the CI failures here: Is there any interesting in merging fixes like this and maybe even make a new release of Lona? |
|
Hey @SmithChart! Long time no see :) thx for this fix! Absolutely! You are right, traffic on this project was pretty low for a long time now, but only because it is (somewhat) done 🤷 It does everything that I needed it to do and it never stopped working. I still get emails from people with questions regulary, so people never stopped using it. I'd be happy to release a new version for you after we get this PR merged. |
When parsing settings overrides from the command line fails, Lona starts up just fine. This leads to situations where Lona may start up, but is actually running with an unexpected configuration. With this change Lona will exit with return code 1 if parsing of an override failed. Signed-off-by: Chris Fiege <cfi@pengutronix.de>
When loading a settings file provided on the command line fails Lona only logs an error but will start up just fine. This leads to situations where Lona may start up, but is actually running with an unexpected configuration. With this change Lona will exit with return code 1 if a settings file could not be loaded. Signed-off-by: Chris Fiege <cfi@pengutronix.de>
2ef0403 to
fbdafc1
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #633 +/- ##
==========================================
+ Coverage 73.12% 73.23% +0.10%
==========================================
Files 88 88
Lines 6128 6130 +2
Branches 1328 1328
==========================================
+ Hits 4481 4489 +8
+ Misses 1364 1361 -3
+ Partials 283 280 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@SmithChart I fixed the CI problems. |
Loading settings is a very early step when starting up Lona. In case that a settings file or a settings override can not be loaded or parsed Lona currently continues to start. But will very likely not be configured in a way that the user expect or want. For example:
With this change Lona will simply refuse to start up and exit with
rc=1.This way a script or service running Lona can catch and report the misconfiguration: