summaryrefslogtreecommitdiff
path: root/lib/chef/knife
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2016-02-16 18:24:52 +0000
committerThom May <thom@may.lt>2016-02-16 18:24:52 +0000
commit8a8513665f8e1f862d73a20a0459352c4a614039 (patch)
treec151d94ae3f345c3c3335d59bc82df63b2aa7712 /lib/chef/knife
parentb49b0d4ab1f48da550a7639f50d68b348fe00a42 (diff)
parent7ba8ea2b93f54bd60049e6f86cba2a73bf845d11 (diff)
downloadchef-8a8513665f8e1f862d73a20a0459352c4a614039.tar.gz
Merge pull request #4581 from chef/tm/h4ck3rm1k3-master-master
bugfix #2865 check for validation_key
Diffstat (limited to 'lib/chef/knife')
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index a863e0cdb7..b05cae688c 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -44,7 +44,8 @@ class Chef
end
def validation_key
- if File.exist?(File.expand_path(@chef_config[:validation_key]))
+ if @chef_config.has_key?(:validation_key) &&
+ File.exist?(File.expand_path(@chef_config[:validation_key]))
IO.read(File.expand_path(@chef_config[:validation_key]))
else
false