Skip to content

Commit

Permalink
vault_secret: Raise an exception if Vault read has failed
Browse files Browse the repository at this point in the history
  • Loading branch information
legal90 committed May 17, 2016
1 parent d61f45b commit 0d4bdc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libraries/vault_secret.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ def config
end

if secret.nil?
Chef::Log.fatal("Could not read secret - #{new_resource.path}")
return
raise "Could not read secret - #{new_resource.path}"
end

node.set['hashicorp-vault']['leases'][new_resource.path] = secret.lease_id if secret.renewable?
Expand All @@ -98,7 +97,7 @@ def config
node.run_state[reference] = secret
new_resource.updated_by_last_action(true)
rescue Vault::HTTPError => e
Chef::Log.warn("Failed to read #{new_resource.path}.\n" + e.message)
raise "Failed to read #{new_resource.path}.\n#{e.message}"
end
end
end
Expand Down

0 comments on commit 0d4bdc1

Please sign in to comment.