Skip to content

Commit

Permalink
Merge pull request #916 from treydock/sensu2-check-env_vars
Browse files Browse the repository at this point in the history
Add env_vars property to sensu_check
  • Loading branch information
ghoneycutt authored Jun 25, 2018
2 parents 3682b0a + a42fe40 commit 7b0a470
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/puppet/type/sensu_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@
newvalues(/.*/, :absent)
end

newproperty(:env_vars, :array_matching => :all, :parent => PuppetX::Sensu::ArrayProperty) do
desc "An array of environment variables to use with command execution."
newvalues(/.*/, :absent)
end

newproperty(:extended_attributes, :parent => PuppetX::Sensu::HashProperty) do
desc "Custom attributes to include as with the check, that appear as outer-level attributes."
defaultto {}
Expand Down
3 changes: 2 additions & 1 deletion spec/unit/sensu_check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
:check_hooks,
:proxy_requests_entity_attributes,
:metric_handlers,
:output_metric_handlers
:output_metric_handlers,
:env_vars
].each do |property|
it "should accept valid #{property}" do
config[property] = ['foo', 'bar']
Expand Down

0 comments on commit 7b0a470

Please sign in to comment.