diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-12-11 13:51:51 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-12-11 13:51:51 -0800 |
commit | b8701a3f9ae8daa758ef6e71e40d121a2fd470e2 (patch) | |
tree | e7bfeb381c0a9fb13c285926bfec5ec80469af30 | |
parent | 1c4c668adaa7102f43459330214367d22797a81c (diff) | |
parent | dc8c2a7fa98a83aceb466f35af36b25153d824c5 (diff) | |
download | chef-b8701a3f9ae8daa758ef6e71e40d121a2fd470e2.tar.gz |
Merge pull request #4288 from chef/jdm/fix-no-proxy
Fix no_proxy setting in chef-config
-rw-r--r-- | chef-config/lib/chef-config/config.rb | 2 | ||||
-rw-r--r-- | chef-config/spec/unit/config_spec.rb | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index 870dd8273c..d8cc4bff37 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -720,7 +720,7 @@ module ChefConfig export_proxy("http", http_proxy, http_proxy_user, http_proxy_pass) if http_proxy export_proxy("https", https_proxy, https_proxy_user, https_proxy_pass) if https_proxy export_proxy("ftp", ftp_proxy, ftp_proxy_user, ftp_proxy_pass) if ftp_proxy - export_no_proxy("no_proxy", no_proxy) if no_proxy + export_no_proxy(no_proxy) if no_proxy end # Builds a proxy uri and exports it to the appropriate environment variables. Examples: diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb index 0a3dca5b5a..8c20b0bef8 100644 --- a/chef-config/spec/unit/config_spec.rb +++ b/chef-config/spec/unit/config_spec.rb @@ -677,6 +677,17 @@ RSpec.describe ChefConfig::Config do end include_examples "no export" end + + context "no_proxy is set" do + before do + ChefConfig::Config.no_proxy = "localhost" + end + it "exports ENV['no_proxy']" do + expect(ENV).to receive(:[]=).with('no_proxy', "localhost") + expect(ENV).to receive(:[]=).with('NO_PROXY', "localhost") + ChefConfig::Config.export_proxies + end + end end describe "allowing chefdk configuration outside of chefdk" do |