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

Remove sensu check property with absent #602

Merged

Conversation

ttarczynski
Copy link
Contributor

This will allow to remove a check property by setting it's value to 'absent'.
I've applied the same logic as in #565 (subdue param only) for all params.

This follows the same logic as puppet type yumrepo:

  • property => undef – no changes are made
  • property => 'absent' – property is removed from json file

I've based this on puppet type yumrepo implementation:

This fixes #601, fixes #535

@ttarczynski
Copy link
Contributor Author

I'ts a work in progress, I'll try to add some test coverage for 'absent' values.

- generate setters and getters for sensu_check properties
- added :absent handling in sensu_check type
- added rspec test for setting sensu_check params to absent
@ttarczynski ttarczynski force-pushed the remove_sensu_check_property_with_absent branch from 0793028 to 094e3d6 Compare January 13, 2017 14:31
@ttarczynski
Copy link
Contributor Author

@jaxxstorm I think this is now ready for merge.

I've added a simple rspec test in sensu_check_spec.rb.
And ensured that 'absent' value is handled properly for boolean and array properties (2edd88f).
Also tested locally if values 'absent' and undef behaves as expected for each property.

This PR only adds :absent handling, but default values (in manifests/check.pp) are still undef which means "unmanaged".

@ttarczynski ttarczynski changed the title [WIP] Remove sensu check property with absent Remove sensu check property with absent Jan 14, 2017
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.

Source parameter not purged when removed from check sensu::check unable to remove a check property
2 participants