Skip to content

Commit

Permalink
Enforce safe_mode value as boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Bashton committed May 7, 2013
1 parent 823081c commit 381e45a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/puppet/type/sensu_client_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def initialize(*args)
desc ""
end

newproperty(:safe_mode) do
newproperty(:safe_mode, :boolean => true) do
desc "Require checks to be defined on server and client"
newvalues(:true, :false)
end

autorequire(:package) do
Expand Down
2 changes: 1 addition & 1 deletion manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$client_name = $::fqdn,
$enabled = 'true',
$purge_config = 'false',
$safe_mode = 'false',
$safe_mode = false,
) {

$ensure = $enabled ? {
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/sensu_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
:address => '1.2.3.4',
:subscriptions => ['all'],
:client_name => 'myclient',
:safe_mode => 'true'
:safe_mode => true
} }

it { should contain_sensu_client_config('host.domain.com').with(
'client_name' => 'myclient',
'address' => '1.2.3.4',
'subscriptions' => ['all'],
'ensure' => 'present',
'safe_mode' => 'true'
'safe_mode' => true
) }

end
Expand Down

0 comments on commit 381e45a

Please sign in to comment.