From b04920a34f49eb39dee7ae3ac94c9052fa06fe75 Mon Sep 17 00:00:00 2001 From: Justin Lambert Date: Thu, 26 Sep 2013 12:57:25 -0600 Subject: [PATCH 1/2] if udp handler socket defined -> to_i --- lib/puppet/provider/sensu_handler/json.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/puppet/provider/sensu_handler/json.rb b/lib/puppet/provider/sensu_handler/json.rb index 76bc9a2d1b..c0aaa28cbe 100644 --- a/lib/puppet/provider/sensu_handler/json.rb +++ b/lib/puppet/provider/sensu_handler/json.rb @@ -72,6 +72,9 @@ def socket def socket=(value) @conf['handlers'][resource[:name]]['socket'] = value + if @conf['handlers'][resource[:name]]['socket'].has_key('port') + @conf['handlers'][resource[:name]]['socket']['port'] = @conf['handlers'][resource[:name]]['socket']['port'].to_i + end end def handlers From 1f966adcaa8064be54b1a866ac8b8a722596e98e Mon Sep 17 00:00:00 2001 From: Justin Lambert Date: Fri, 27 Sep 2013 06:17:52 -0600 Subject: [PATCH 2/2] fix has_key? --- lib/puppet/provider/sensu_handler/json.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/sensu_handler/json.rb b/lib/puppet/provider/sensu_handler/json.rb index c0aaa28cbe..710e8d5901 100644 --- a/lib/puppet/provider/sensu_handler/json.rb +++ b/lib/puppet/provider/sensu_handler/json.rb @@ -72,7 +72,7 @@ def socket def socket=(value) @conf['handlers'][resource[:name]]['socket'] = value - if @conf['handlers'][resource[:name]]['socket'].has_key('port') + if @conf['handlers'][resource[:name]]['socket'].has_key?('port') @conf['handlers'][resource[:name]]['socket']['port'] = @conf['handlers'][resource[:name]]['socket']['port'].to_i end end