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

Fixes for dependencies and subscribers properties in sensu::check. #285

Merged
merged 3 commits into from
Jan 13, 2015
Merged

Fixes for dependencies and subscribers properties in sensu::check. #285

merged 3 commits into from
Jan 13, 2015

Conversation

jonathanio
Copy link
Contributor

Fixes two issues with the Puppet configuration:

  • The dependencies property is not handled correctly by the provider causing it to be added or removed with alternate runs; and
  • Set subscribers property in sensu::check as undef to prevent empty array output in configuration.

@jamtur01
Copy link
Contributor

Hi @jonathanio - thanks for this - can you please fix the test failures. Thanks!

https://travis-ci.org/sensu/sensu-puppet/jobs/43877609

If the dependencies propery is defined in the Puppet resource, the type
will alternate between adding and removing it on runs as under the
create method it's not added, while subsequently it's not included in
the list from check_args.

This causes the first run to not add it, the second (and each subsequent
even) run to add it in, and then each odd run to remove it as it's now
classed as a custom property instead and doesn't match that provided
by the resource.
The subscriptions property is an optional one and when set to [] it will
always give an empty array in the JSON exported. Setting to undef will
clean up any new configuration created (it shouldn't affect existing
configuration and puppet will consider undef/nil/empty arrays as
equivalent by the looks of it when :array_matching is set in the type).
Fixed the defaults in sensu_check_spec.rb as the default no longer
includes an empty array for subscribers.
@jonathanio
Copy link
Contributor Author

This failure seams to be an issue with the puppet module itself. It fails on my branch and on master on my machine at the moment?

jamtur01 added a commit that referenced this pull request Jan 13, 2015
Fixes for dependencies and subscribers properties in sensu::check.
@jamtur01 jamtur01 merged commit f1f7273 into sensu:master Jan 13, 2015
thejandroman pushed a commit to Ensighten/sensu-puppet that referenced this pull request Aug 2, 2016
This commit fixes the error message: `undefined method `sort' for
nil:NilClass`. This error message can be seen when either the handlers
or subscribers parameters are passed in as  `undef` in the check.pp
manifest.

The PRs that looks like they introduced this behavior are:
sensu#285
sensu#303
thejandroman pushed a commit to Ensighten/sensu-puppet that referenced this pull request Aug 5, 2016
This commit fixes the error message: `undefined method `sort' for
nil:NilClass`. This error message can be seen when either the handlers
or subscribers parameters are passed in as  `undef` in the check.pp
manifest.

The PRs that looks like they introduced this behavior are:
sensu#285
sensu#303
thejandroman pushed a commit to Ensighten/sensu-puppet that referenced this pull request Aug 18, 2016
This commit fixes the error message: `undefined method `sort' for
nil:NilClass`. This error message can be seen when either the handlers
or subscribers parameters are passed in as  `undef` in the check.pp
manifest.

The PRs that looks like they introduced this behavior are:
sensu#285
sensu#303
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