Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no_proxy setting in chef-config #4288

Merged
merged 1 commit into from
Dec 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chef-config/lib/chef-config/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def self.export_proxies
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:
Expand Down
11 changes: 11 additions & 0 deletions chef-config/spec/unit/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,17 @@ def to_platform(*args)
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
Expand Down