diff options
author | Claire McQuin <claire@getchef.com> | 2014-09-05 16:28:25 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-09-08 15:21:15 -0700 |
commit | 299a8d1ee016b3934027b96e1e45bc5c8eaff632 (patch) | |
tree | ce4596bae468865118e5f352d8891dd8434b8aa6 | |
parent | b6b9b667af1865fdf8aace2bdd771a2553986bbd (diff) | |
download | chef-299a8d1ee016b3934027b96e1e45bc5c8eaff632.tar.gz |
Look for certs only if :trusted_certs_dir is not nil
-rw-r--r-- | lib/chef/knife/core/bootstrap_context.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb index 52b9c93807..6bc48636c5 100644 --- a/lib/chef/knife/core/bootstrap_context.rb +++ b/lib/chef/knife/core/bootstrap_context.rb @@ -164,9 +164,11 @@ CONFIG private def trusted_certs_content content = "" - Dir.glob(File.join(@chef_config[:trusted_certs_dir], "*.{crt,pem}")).each do |cert| - content << "cat > /etc/chef/trusted_certs/#{File.basename(cert)} <<'EOP'\n" + - IO.read(File.expand_path(cert)) + "\nEOP\n" + if @chef_config[:trusted_certs_dir] + Dir.glob(File.join(@chef_config[:trusted_certs_dir], "*.{crt,pem}")).each do |cert| + content << "cat > /etc/chef/trusted_certs/#{File.basename(cert)} <<'EOP'\n" + + IO.read(File.expand_path(cert)) + "\nEOP\n" + end end content end |