diff options
author | Jesse Campbell <hikeit@gmail.com> | 2013-03-01 21:49:29 -0500 |
---|---|---|
committer | Jesse Campbell <hikeit@gmail.com> | 2013-03-01 21:49:29 -0500 |
commit | dade9779168a75c84be1e964517412fc89798405 (patch) | |
tree | e15e85d5d8432400b55119ec8a7ae77de4effb8b /lib/chef/provider/remote_file.rb | |
parent | 4afe11aaad85538ba2204e5529b62349586c2b11 (diff) | |
download | chef-dade9779168a75c84be1e964517412fc89798405.tar.gz |
move proxy config to ftp
Diffstat (limited to 'lib/chef/provider/remote_file.rb')
-rw-r--r-- | lib/chef/provider/remote_file.rb | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/chef/provider/remote_file.rb b/lib/chef/provider/remote_file.rb index a81e5b7737..805c1f909e 100644 --- a/lib/chef/provider/remote_file.rb +++ b/lib/chef/provider/remote_file.rb @@ -141,7 +141,7 @@ class Chef raw_file, mtime, etag = HTTP::fetch(uri, if_modified_since, if_none_match) elsif URI::FTP === uri #FTP - raw_file, mtime = FTP::fetch(uri, proxy_uri(uri), @new_resource.ftp_active_mode, if_modified_since) + raw_file, mtime = FTP::fetch(uri, @new_resource.ftp_active_mode, if_modified_since) etag = nil elsif uri.scheme == "file" #local/network file @@ -157,21 +157,6 @@ class Chef return raw_file end - #adapted from buildr/lib/buildr/core/transports.rb via chef/rest/rest_client.rb - def proxy_uri(uri) - proxy = Chef::Config["#{uri.scheme}_proxy"] - proxy = URI.parse(proxy) if String === proxy - if Chef::Config["#{uri.scheme}_proxy_user"] - proxy.user = Chef::Config["#{uri.scheme}_proxy_user"] - end - if Chef::Config["#{uri.scheme}_proxy_pass"] - proxy.password = Chef::Config["#{uri.scheme}_proxy_pass"] - end - excludes = Chef::Config[:no_proxy].to_s.split(/\s*,\s*/).compact - excludes = excludes.map { |exclude| exclude =~ /:\d+$/ ? exclude : "#{exclude}:*" } - return proxy unless excludes.any? { |exclude| File.fnmatch(exclude, "#{host}:#{port}") } - end - def load_fileinfo begin Chef::JSONCompat.from_json(Chef::FileCache.load("remote_file/#{new_resource.name}")) |