diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-05 12:20:02 -0500 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-05 12:07:11 -0700 |
commit | e4721a3e89e24614eebd6302e53b3b91d4535a92 (patch) | |
tree | b4fa8c94c01690604f51c392f5d9c451964d7ecc /lib/chef/provider/remote_file/content.rb | |
parent | 8c92948746bc418fac09218814a9cfb9e4894b5d (diff) | |
download | chef-e4721a3e89e24614eebd6302e53b3b91d4535a92.tar.gz |
remote_file support for windows network shares
```ruby
remote_file 'C:\Foo.tar.gz' do
source "\\\\foohost\\fooshare\\Foo.tar.gz"
end
```
Diffstat (limited to 'lib/chef/provider/remote_file/content.rb')
-rw-r--r-- | lib/chef/provider/remote_file/content.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/provider/remote_file/content.rb b/lib/chef/provider/remote_file/content.rb index ef55dd77cd..938a7e58f4 100644 --- a/lib/chef/provider/remote_file/content.rb +++ b/lib/chef/provider/remote_file/content.rb @@ -45,7 +45,11 @@ class Chef sources = sources.dup source = sources.shift begin - uri = URI.parse(source) + uri = if Chef::Provider::RemoteFile::Fetcher.network_share?(source) + source + else + URI.parse(source) + end raw_file = grab_file_from_uri(uri) rescue SocketError, Errno::ECONNREFUSED, Errno::ENOENT, Errno::EACCES, Timeout::Error, Net::HTTPServerException, Net::HTTPFatalError, Net::FTPError => e Chef::Log.warn("#{@new_resource} cannot be downloaded from #{source}: #{e.to_s}") |