Skip to content

Commit

Permalink
[sensu_check] fix conditional validation of subscribers/standalone (#547
Browse files Browse the repository at this point in the history
)

* [sensu_check] fix conditional validation of required subscribers/standalone attribute
* [sensu_check] ensure action is an array before checking for :create
  • Loading branch information
cwjohnston authored Mar 14, 2017
1 parent 9a942f1 commit 753b174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def after_created
raise Chef::Exceptions::ValidationFailed, "Sensu check #{name}: name cannot contain spaces or special characters"
end

if action == :create
if [action].compact.flatten.include?(:create)
raise Chef::Exceptions::ValidationFailed, "Sensu check #{name}: must either define subscribers, or has to be standalone." unless (subscribers || standalone)
end
end

0 comments on commit 753b174

Please sign in to comment.