summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Shirinkin <fodojyko@gmail.com>2014-09-04 11:20:17 +0200
committerLamont Granquist <lamont@scriptkiddie.org>2014-09-10 14:31:33 -0700
commit8ec8e4850f3c0222df965bfe34ac0fdf215c1d24 (patch)
treeebc03acd7f684707bf3211a8b818893d4fe03082
parent549f629d1b23010ebd9dd811babca7f174fd6af1 (diff)
downloadchef-8ec8e4850f3c0222df965bfe34ac0fdf215c1d24.tar.gz
rebase
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index 12d422a162..9fa6dcc46f 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -44,8 +44,10 @@ class Chef
def encrypted_data_bag_secret
knife_config[:secret] || begin
- if knife_config[:secret_file] && File.exist?(knife_config[:secret_file])
- IO.read(File.expand_path(knife_config[:secret_file]))
+ secret_file_path = knife_config[:secret_file]
+ expanded_secret_file_path = File.expand_path(secret_file_path.to_s)
+ if secret_file_path && File.exist?(expanded_secret_file_path)
+ IO.read(expanded_secret_file_path)
else
nil
end