From 5064b8797cc03134712756eeecc3947cebe12934 Mon Sep 17 00:00:00 2001 From: Justin Lambert Date: Thu, 9 May 2013 09:07:15 -0600 Subject: [PATCH] ensure safe_mode param is a boolean --- lib/puppet/provider/sensu_client_config/json.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/sensu_client_config/json.rb b/lib/puppet/provider/sensu_client_config/json.rb index a64f60e7c6..f7ca47cb01 100644 --- a/lib/puppet/provider/sensu_client_config/json.rb +++ b/lib/puppet/provider/sensu_client_config/json.rb @@ -61,11 +61,24 @@ def subscriptions=(value) end def safe_mode - @conf['client']['safe_mode'] + case @conf['client']['safe_mode'] + when true + :true + when false + :false + else + @conf['client']['safe_mode'] + end end def safe_mode=(value) - @conf['client']['safe_mode'] = value + case value + when true, 'true', 'True', :true, 1 + @conf['client']['safe_mode'] = true + else + @conf['client']['safe_mode'] = false + end end end +