From a05c8396c159b0bc123f0d98c644517c573a1710 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sun, 24 Dec 2023 22:39:37 -0800 Subject: [PATCH] fix(pkcs7): fix warning of both public_key/public_key_env_var to reflect code If both public_key and public_key_env_var were set, this message triggred: `both public_key and public_key_env_var specified, using public_key` However, the code actually preferred the `public_key_env_var` path. Change the warning to reflect that. Also change a similar line for private_key/private_key_env_var. Signed-off-by: Robin H. Johnson Resolves: https://github.com/voxpupuli/hiera-eyaml/pull/360#discussion_r1435966701 --- lib/hiera/backend/eyaml/encryptors/pkcs7.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hiera/backend/eyaml/encryptors/pkcs7.rb b/lib/hiera/backend/eyaml/encryptors/pkcs7.rb index 84d7175..b747c94 100644 --- a/lib/hiera/backend/eyaml/encryptors/pkcs7.rb +++ b/lib/hiera/backend/eyaml/encryptors/pkcs7.rb @@ -40,7 +40,7 @@ def self.encrypt(plaintext) public_key_env_var = option :public_key_env_var if public_key and public_key_env_var - warn 'both public_key and public_key_env_var specified, using public_key' + warn 'both public_key and public_key_env_var specified, using public_key_env_var' end if public_key_env_var @@ -70,10 +70,10 @@ def self.decrypt(ciphertext) raise StandardError, 'pkcs7_private_key is not defined' unless private_key or private_key_env_var if public_key and public_key_env_var - warn 'both public_key and public_key_env_var specified, using public_key' + warn 'both public_key and public_key_env_var specified, using public_key_env_var' end if private_key and private_key_env_var - warn 'both private_key and private_key_env_var specified, using private_key' + warn 'both private_key and private_key_env_var specified, using private_key_env_var' end private_key_pem = if private_key_env_var and ENV[private_key_env_var]