Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hint of previous object when duplicate detection fails #479

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

sni
Copy link
Contributor

@sni sni commented Sep 27, 2024

whenever naemon encounters a 'Error: Duplicate definition found for' it will now print the location of the previous object definition as well to make debugging easier.

While on it, rework xodtemplate_add_object_property() a bit and clean up code. Instead of setting a result, simply return early with the error. There is no cleanup at the end or something like that. Also cleanup the double use of the result variable which was used for the result but also for determing if there is a value set or not.

whenever naemon encounters a 'Error: Duplicate definition found for' it will
now print the location of the previous object definition as well to make
debugging easier.

While on it, rework xodtemplate_add_object_property() a bit and clean up code.
Instead of setting a result, simply return early with the error. There is no
cleanup at the end or something like that. Also cleanup the double use of the
result variable which was used for the result but also for determing if there
is a value set or not.

Signed-off-by: Sven Nierlein <[email protected]>
currently naemon silently ignores invalid bool values. For ex.:

    register_object yes

does not result in an error but the int value of "yes" is still 0, so the
object won't be registered.

This change adds boolean validation and prints out an error in case the
value is not either 0 or 1.
@sni
Copy link
Contributor Author

sni commented Sep 27, 2024

adding and adopting #478 here since they had conflicts which are resolved with this PR

for some attributes the parser set a flag. This has to be done before returning
from the bool parser.
Copy link
Member

@nook24 nook24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have checked for any leftovers but you already catched all boolean values :)

@nook24 nook24 added Approved and removed Approved labels Sep 30, 2024
@sni sni merged commit 9e69398 into naemon:master Sep 30, 2024
31 checks passed
@sni sni deleted the improve_config_parser branch September 30, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants