lib/hiera/backend/vault_backend.rb in confidante-0.28.0.pre.16 vs lib/hiera/backend/vault_backend.rb in confidante-0.28.0.pre.17
- old
+ new
@@ -15,13 +15,14 @@
Hiera.debug("Looking up #{key} in vault backend " \
"with #{resolution_type}")
vault_config = Backend.parse_answer(Config[:vault], scope)
vault_address = vault_config[:address]
- vault_client = Vault::Client.new(address: vault_address)
- value = get_value(vault_client, key, vault_config[:sources])
+ throw :no_vault_address_provided unless vault_address
+ vault_client = Vault::Client.new(address: vault_address)
+ value = get_value(vault_client, key, vault_config[:sources])
Backend.parse_answer(value, scope)
end
def get_value(vault_client, key, sources)
found_source = sources.find do |source|