summaryrefslogtreecommitdiff
path: root/lib/chef/knife
diff options
context:
space:
mode:
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