From e638e7c9685d375afbfba2949943da1c542dae53 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 28 Sep 2016 16:14:35 +0300 Subject: interpolate node variable values Empty value was variably considered "" or nil, now it will always be "" string. Now "nil", "false", "true" strings are converted to their respective types nil, false and true. This also means we cannot have verbatim strings by that name, like if your password was "false", you're shit out of luck. If this is the case, we can add some __false__ hack or consider other similar solutions. Fixes #500 Fixes #534 May break stuff with ""/nil changing now, but as it was not consistent to begin with, I find it acceptable. Users now may need to manually enter nil in some fields to regain old behaviour. --- lib/oxidized/source/http.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/oxidized/source/http.rb') diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb index 93361a2..38387ad 100644 --- a/lib/oxidized/source/http.rb +++ b/lib/oxidized/source/http.rb @@ -43,9 +43,11 @@ class HTTP < Source end keys[:model] = map_model keys[:model] if keys.key? :model - # map node specific vars, empty value is considered as nil + # map node specific vars vars = {} - @cfg.vars_map.each { |key, position| vars[key.to_sym] = line[position].to_s.empty? ? nil : line[position] } + @cfg.vars_map.each do |key, position| + vars[key.to_sym] = node_var_interpolate line[position] + end keys[:vars] = vars unless vars.empty? nodes << keys -- cgit v1.2.1 From 6612535aa3378b99f836b41e675bf8f92a1159e7 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 12 Oct 2016 21:55:38 +0300 Subject: Interpolate also node variables, not just vars map Fixes #583 --- lib/oxidized/source/http.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/source/http.rb') diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb index 38387ad..dc1c0b7 100644 --- a/lib/oxidized/source/http.rb +++ b/lib/oxidized/source/http.rb @@ -39,7 +39,7 @@ class HTTP < Source # map node parameters keys = {} @cfg.map.each do |key, position| - keys[key.to_sym] = line[position] + keys[key.to_sym] = node_var_interpolate line[position] end keys[:model] = map_model keys[:model] if keys.key? :model -- cgit v1.2.1 From 59e82bba2befb6ef5049ea9ae4e876327f3da158 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sat, 19 Nov 2016 14:16:20 +0000 Subject: Added option to disable ssl verification checks for http source --- lib/oxidized/source/http.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/oxidized/source/http.rb') diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb index dc1c0b7..6f16aee 100644 --- a/lib/oxidized/source/http.rb +++ b/lib/oxidized/source/http.rb @@ -20,6 +20,7 @@ class HTTP < Source uri = URI.parse(@cfg.url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == 'https' + http.verify_mode = OpenSSL::SSL::VERIFY_NONE if uri.no_check_certificate == true # map headers headers = {} -- cgit v1.2.1 From 44574426d076c15f67ee9738b1c8c86d71910cce Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sat, 19 Nov 2016 15:56:52 +0000 Subject: Updated config options --- lib/oxidized/source/http.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/source/http.rb') diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb index 6f16aee..4fd388b 100644 --- a/lib/oxidized/source/http.rb +++ b/lib/oxidized/source/http.rb @@ -20,7 +20,7 @@ class HTTP < Source uri = URI.parse(@cfg.url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == 'https' - http.verify_mode = OpenSSL::SSL::VERIFY_NONE if uri.no_check_certificate == true + http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @cfg.secure # map headers headers = {} -- cgit v1.2.1