Skip to content

Conversation

@basvandervlies
Copy link
Contributor

Only pass check if there is no result, eg:

  • check_file_test -n -e /etc/node_status/reboot_node

This check will pass if the file is absent

@mej
Copy link
Owner

mej commented Oct 30, 2018

Two things on this.

First, I prefer that enhancements/new features be targetted at the dev branch rather than the master branch so that they can be tested and vetted before being fully merged. So if you could rebase this request against dev instead, that'd be great. :)

Second, I already have a convention for using -! to negate the result of a check. For consistency, and since it matches up with the goal of this check anyway -- that is, being an analog for the bash shell's built-in test command -- what would you think about changing your -n to -! instead?

@mej mej self-assigned this Oct 30, 2018
@mej mej added this to the 1.4.3 Release milestone Oct 30, 2018
@basvandervlies
Copy link
Contributor Author

No problem I will rebase it to dev and change it to: -! . I used check_dmi_data_match as example it use -n | !

@mej
Copy link
Owner

mej commented Oct 31, 2018

I used check_dmi_data_match as example it use -n | !

Good point. I should fix that for consistency. That was one of the very early checks where the need for negating the overall check result, rather than the particular match string, became evident to me, so it predates the convention. Thanks for catching that! :-)

@basvandervlies basvandervlies force-pushed the check_file_test_negative branch from 0f45f3c to 2627030 Compare October 31, 2018 19:26
@basvandervlies basvandervlies changed the base branch from master to dev October 31, 2018 19:28
Only pass check if there is no result, eg:
 *  check_file_test -! -e /etc/node_status/reboot_node

This check will pass if the file is absent
@basvandervlies basvandervlies force-pushed the check_file_test_negative branch from 2627030 to 8026428 Compare October 31, 2018 19:32
mej added a commit that referenced this pull request Nov 1, 2018
As @basvandervlies pointed out in #68, `check_dmi_data_match()` used
`-n` or a bare `!` for negation of the overall check.  The newer
convention is to use `-!` for this, as I mentioned in my prior comment
to that Issue, so this commit updates `check_dmi_data_match()` to
accept that flag.  The prior syntax will be deprecated in a future
version and eventually removed.
@mej mej merged commit 2e4e4e9 into mej:dev Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants