summaryrefslogtreecommitdiff
path: root/lib/chef/provider/remote_file/content.rb
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-05-19 19:27:00 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-05-21 10:12:58 -0500
commit6ba819dd88383a9ad7ef7af5b013cbf6a4da2c84 (patch)
tree55eff88af3c3a71a6ba78fcc9f9c8554dd4bc4f3 /lib/chef/provider/remote_file/content.rb
parent605552d20d7dee84484f9d197d11a42c05d0ee1f (diff)
downloadchef-6ba819dd88383a9ad7ef7af5b013cbf6a4da2c84.tar.gz
Allow spaces in files for remote_file
The following example now works ```ruby remote_file "c:\\nospaces" do source "file:///c:/foo bar" end ```
Diffstat (limited to 'lib/chef/provider/remote_file/content.rb')
-rw-r--r--lib/chef/provider/remote_file/content.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chef/provider/remote_file/content.rb b/lib/chef/provider/remote_file/content.rb
index 938a7e58f4..4f450ce333 100644
--- a/lib/chef/provider/remote_file/content.rb
+++ b/lib/chef/provider/remote_file/content.rb
@@ -20,6 +20,7 @@
require 'uri'
require 'tempfile'
require 'chef/file_content_management/content_base'
+require 'chef/mixin/uris'
class Chef
class Provider
@@ -28,6 +29,8 @@ class Chef
private
+ include Chef::Mixin::Uris
+
def file_for_provider
Chef::Log.debug("#{@new_resource} checking for changes")
@@ -48,7 +51,7 @@ class Chef
uri = if Chef::Provider::RemoteFile::Fetcher.network_share?(source)
source
else
- URI.parse(source)
+ as_uri(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