diff options
author | Salim Alam <salam@chef.io> | 2016-03-23 14:10:21 -0700 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2016-03-23 14:16:42 -0700 |
commit | 96c5155472824d6c9e8fcb2b5c7283bcf9abf483 (patch) | |
tree | 61cca70267b1ca253d60addb8dc1531e5f4cc3bd /lib/chef/provider/subversion.rb | |
parent | e8336f4f930324631b2c2d3dcc999ca0c87fb99c (diff) | |
download | chef-96c5155472824d6c9e8fcb2b5c7283bcf9abf483.tar.gz |
Use Chef::Config.proxy_urisalam/subversion-fix
Diffstat (limited to 'lib/chef/provider/subversion.rb')
-rw-r--r-- | lib/chef/provider/subversion.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/chef/provider/subversion.rb b/lib/chef/provider/subversion.rb index 287a9f64a1..ea32283bc9 100644 --- a/lib/chef/provider/subversion.rb +++ b/lib/chef/provider/subversion.rb @@ -197,18 +197,13 @@ class Chef end def proxy - %w{http https}.each { |p| - if @new_resource.repository.start_with?("#{p}:") && - ENV["#{p}_proxy"] != nil && - !fuzzy_hostname_match_any?(URI.parse(@new_resource.repository).host, ENV["no_proxy"]) - proxy_uri = URI.parse(ENV["#{p}_proxy"]) - result = "--config-option servers:global:http-proxy-host=#{proxy_uri.host} " - result << "--config-option servers:global:http-proxy-port=#{proxy_uri.port} " - return result - end - } + repo_uri = URI.parse(@new_resource.repository) + proxy_uri = Chef::Config.proxy_uri(repo_uri.scheme, repo_uri.host, repo_uri.port) + return "" if proxy_uri.nil? - "" + result = "--config-option servers:global:http-proxy-host=#{proxy_uri.host} " + result << "--config-option servers:global:http-proxy-port=#{proxy_uri.port} " + result end def scm(*args) |