Commit d9264cf5 authored by Geoff Meakin's avatar Geoff Meakin

Make error message a bit more meaningful if cannot decrypt

parent 9b20b33d
......@@ -85,8 +85,12 @@ class Hiera
private_key = OpenSSL::PKey::RSA.new(File.read( private_key_path ))
plain_text = private_key.private_decrypt( Base64.decode64(cipher_text) )
begin
plain_text = private_key.private_decrypt( Base64.decode64(cipher_text) )
rescue
raise Exception, "Hiera eyaml backend: Unable to decrypt hiera data. Private key mismatch?"
end
return plain_text
else
return value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment