diff options
author | Claire McQuin <claire@getchef.com> | 2014-05-27 13:43:38 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-06-03 09:16:54 -0700 |
commit | e52798c5fda734553304e98585cbe5142bc116c9 (patch) | |
tree | fbd1f1a1e8cdfdc4ea4b027c5d0ec1446cf77cb1 | |
parent | b77404a53a50fa699d4358fd92f194223c56e70d (diff) | |
download | chef-e52798c5fda734553304e98585cbe5142bc116c9.tar.gz |
rename configure_environment_variables to configure_proxy_environment_variables
-rw-r--r-- | lib/chef/application.rb | 6 | ||||
-rw-r--r-- | lib/chef/application/apply.rb | 2 | ||||
-rw-r--r-- | lib/chef/application/windows_service.rb | 2 | ||||
-rw-r--r-- | spec/functional/application_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/application_spec.rb | 38 |
5 files changed, 25 insertions, 25 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 68108d21bc..83295bed8d 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -44,7 +44,7 @@ class Chef::Application def reconfigure configure_chef configure_logging - configure_environment_variables + configure_proxy_environment_variables end # Get this party started @@ -166,8 +166,8 @@ class Chef::Application end end - # Configure and set any environment variables according to the config. - def configure_environment_variables + # Configure and set any proxy environment variables according to the config. + def configure_proxy_environment_variables configure_http_proxy configure_https_proxy configure_ftp_proxy diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb index 983b35d5b7..ab35b35389 100644 --- a/lib/chef/application/apply.rb +++ b/lib/chef/application/apply.rb @@ -88,7 +88,7 @@ class Chef::Application::Apply < Chef::Application parse_options Chef::Config.merge!(config) configure_logging - configure_environment_variables + configure_proxy_environment_variables end def read_recipe_file(file_name) diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index 2f81256a63..d1810fc3e8 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -211,7 +211,7 @@ class Chef def reconfigure(startup_parameters=[]) configure_chef startup_parameters configure_logging - configure_environment_variables + configure_proxy_environment_variables Chef::Config[:chef_server_url] = config[:chef_server_url] if config.has_key? :chef_server_url unless Chef::Config[:exception_handlers].any? {|h| Chef::Handler::ErrorReport === h} diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb index c6dec12983..bed293a80d 100644 --- a/spec/functional/application_spec.rb +++ b/spec/functional/application_spec.rb @@ -38,7 +38,7 @@ describe Chef::Application do Chef::Config[:ftp_proxy] = nil Chef::Config[:no_proxy] = nil - @app.configure_environment_variables + @app.configure_proxy_environment_variables end it "saves built proxy to ENV which shell_out can use" do diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb index 698999b8dc..e148ab40a3 100644 --- a/spec/unit/application_spec.rb +++ b/spec/unit/application_spec.rb @@ -39,7 +39,7 @@ describe Chef::Application do @app = Chef::Application.new @app.stub(:configure_chef).and_return(true) @app.stub(:configure_logging).and_return(true) - @app.stub(:configure_environment_variables).and_return(true) + @app.stub(:configure_proxy_environment_variables).and_return(true) end it "should configure chef" do @@ -53,7 +53,7 @@ describe Chef::Application do end it "should configure environment variables" do - @app.should_receive(:configure_environment_variables).and_return(true) + @app.should_receive(:configure_proxy_environment_variables).and_return(true) @app.reconfigure end end @@ -241,7 +241,7 @@ describe Chef::Application do end describe "when configuring environment variables" do - def configure_environment_variables_stubs + def configure_proxy_environment_variables_stubs @app.stub(:configure_http_proxy).and_return(true) @app.stub(:configure_https_proxy).and_return(true) @app.stub(:configure_ftp_proxy).and_return(true) @@ -249,27 +249,27 @@ describe Chef::Application do end it "should configure ENV['HTTP_PROXY']" do - configure_environment_variables_stubs + configure_proxy_environment_variables_stubs @app.should_receive(:configure_http_proxy) - @app.configure_environment_variables + @app.configure_proxy_environment_variables end it "should configure ENV['HTTPS_PROXY']" do - configure_environment_variables_stubs + configure_proxy_environment_variables_stubs @app.should_receive(:configure_https_proxy) - @app.configure_environment_variables + @app.configure_proxy_environment_variables end it "should configure ENV['FTP_PROXY']" do - configure_environment_variables_stubs + configure_proxy_environment_variables_stubs @app.should_receive(:configure_ftp_proxy) - @app.configure_environment_variables + @app.configure_proxy_environment_variables end it "should configure ENV['NO_PROXY']" do - configure_environment_variables_stubs + configure_proxy_environment_variables_stubs @app.should_receive(:configure_no_proxy) - @app.configure_environment_variables + @app.configure_proxy_environment_variables end describe "when configuring ENV['HTTP_PROXY']" do @@ -288,7 +288,7 @@ describe Chef::Application do end it "should not set ENV['HTTP_PROXY']" do - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env.should == {} end end @@ -299,13 +299,13 @@ describe Chef::Application do end it "should set ENV['HTTP_PROXY'] to http://hostname:port" do - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env['HTTP_PROXY'].should == "http://hostname:port" end it "should percent encode the proxy, if necessary" do Chef::Config[:http_proxy] = "http://needs\\some escaping:1234" - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env['HTTP_PROXY'].should == "http://needs%5Csome%20escaping:1234" end @@ -315,13 +315,13 @@ describe Chef::Application do end it "should set ENV['HTTP_PROXY'] to http://username@hostname.port" do - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env['HTTP_PROXY'].should == "http://username@hostname:port" end it "should percent encode the username, including @ and : characters" do Chef::Config[:http_proxy_user] = "K:tty C@t" - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env['HTTP_PROXY'].should == "http://K%3Atty%20C%40t@hostname:port" end @@ -331,13 +331,13 @@ describe Chef::Application do end it "should set ENV['HTTP_PROXY'] to http://username:password@hostname:port" do - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env['HTTP_PROXY'].should == "http://username:password@hostname:port" end it "should fully percent escape the password, including @ and : characters" do Chef::Config[:http_proxy_pass] = ":P@ssword101" - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env['HTTP_PROXY'].should == "http://username:%3AP%40ssword101@hostname:port" end end @@ -350,7 +350,7 @@ describe Chef::Application do end it "should set ENV['HTTP_PROXY'] to http://hostname:port" do - @app.configure_environment_variables + @app.configure_proxy_environment_variables @env['HTTP_PROXY'].should == "http://hostname:port" end end |