From a5ae9a85ab0651f62928ccbd472a7fe68621064e Mon Sep 17 00:00:00 2001 From: David Alden Date: Sun, 19 Feb 2017 16:27:38 -0500 Subject: [PATCH] Fixed an interesting bug. The following line does not do what many would expect: (#26) --- lib/hiera/backend/vault_backend.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hiera/backend/vault_backend.rb b/lib/hiera/backend/vault_backend.rb index 902c371..8cba891 100644 --- a/lib/hiera/backend/vault_backend.rb +++ b/lib/hiera/backend/vault_backend.rb @@ -28,10 +28,10 @@ def initialize() begin @vault = Vault::Client.new @vault.configure do |config| - config.address = @config[:addr] if @config[:addr] - config.token = @config[:token] if @config[:token] - config.ssl_pem_file = @config[:ssl_pem_file] if @config[:ssl_pem_file] - config.ssl_verify = @config[:ssl_verify] if @config[:ssl_verify] + config.address = @config[:addr] unless @config[:addr].nil? + config.token = @config[:token] unless @config[:token].nil? + config.ssl_pem_file = @config[:ssl_pem_file] unless @config[:ssl_pem_file].nil? + config.ssl_verify = @config[:ssl_verify] unless @config[:ssl_verify].nil? config.ssl_ca_cert = @config[:ssl_ca_cert] if config.respond_to? :ssl_ca_cert config.ssl_ca_path = @config[:ssl_ca_path] if config.respond_to? :ssl_ca_path config.ssl_ciphers = @config[:ssl_ciphers] if config.respond_to? :ssl_ciphers