From 6ba819dd88383a9ad7ef7af5b013cbf6a4da2c84 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Tue, 19 May 2015 19:27:00 -0700 Subject: Allow spaces in files for remote_file The following example now works ```ruby remote_file "c:\\nospaces" do source "file:///c:/foo bar" end ``` --- lib/chef/provider/remote_file/content.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/chef/provider/remote_file/content.rb') 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 -- cgit v1.2.1