summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/provider/remote_file/content.rb3
-rw-r--r--lib/chef/provider/remote_file/ftp.rb5
-rw-r--r--lib/chef/provider/remote_file/http.rb4
-rw-r--r--lib/chef/provider/remote_file/local_file.rb3
-rw-r--r--lib/chef/provider/remote_file/result.rb39
-rw-r--r--lib/chef/providers.rb1
6 files changed, 5 insertions, 50 deletions
diff --git a/lib/chef/provider/remote_file/content.rb b/lib/chef/provider/remote_file/content.rb
index d75ee735a1..7f9e2332a8 100644
--- a/lib/chef/provider/remote_file/content.rb
+++ b/lib/chef/provider/remote_file/content.rb
@@ -62,8 +62,7 @@ class Chef
# Given a source uri, return a Tempfile, or a File that acts like a Tempfile (close! method)
def grab_file_from_uri(uri)
- result = Chef::Provider::RemoteFile::Fetcher.for_resource(uri, @new_resource, @current_resource).fetch
- result.raw_file
+ Chef::Provider::RemoteFile::Fetcher.for_resource(uri, @new_resource, @current_resource).fetch
end
def current_resource_matches_target_checksum?
diff --git a/lib/chef/provider/remote_file/ftp.rb b/lib/chef/provider/remote_file/ftp.rb
index 865667a31c..d75fb7a52c 100644
--- a/lib/chef/provider/remote_file/ftp.rb
+++ b/lib/chef/provider/remote_file/ftp.rb
@@ -20,7 +20,6 @@ require 'uri'
require 'tempfile'
require 'net/ftp'
require 'chef/provider/remote_file'
-require 'chef/provider/remote_file/result'
require 'chef/file_content_management/tempfile'
class Chef
@@ -85,10 +84,8 @@ class Chef
def fetch
with_connection do
- tempfile = get
- @result = Chef::Provider::RemoteFile::Result.new(tempfile, nil, nil)
+ get
end
- @result
end
def ftp
diff --git a/lib/chef/provider/remote_file/http.rb b/lib/chef/provider/remote_file/http.rb
index 855041f91e..6ffd83f438 100644
--- a/lib/chef/provider/remote_file/http.rb
+++ b/lib/chef/provider/remote_file/http.rb
@@ -20,7 +20,6 @@
require 'chef/rest'
require 'chef/digester'
require 'chef/provider/remote_file'
-require 'chef/provider/remote_file/result'
require 'chef/provider/remote_file/cache_control_data'
class Chef
@@ -69,7 +68,8 @@ class Chef
raise e
end
end
- return Chef::Provider::RemoteFile::Result.new(tempfile, cache_control_data.etag, cache_control_data.mtime)
+
+ tempfile
end
private
diff --git a/lib/chef/provider/remote_file/local_file.rb b/lib/chef/provider/remote_file/local_file.rb
index 233076ceb6..87f498e053 100644
--- a/lib/chef/provider/remote_file/local_file.rb
+++ b/lib/chef/provider/remote_file/local_file.rb
@@ -19,7 +19,6 @@
require 'uri'
require 'tempfile'
require 'chef/provider/remote_file'
-require 'chef/provider/remote_file/result'
class Chef
class Provider
@@ -39,7 +38,7 @@ class Chef
tempfile = Chef::FileContentManagement::Tempfile.new(new_resource).tempfile
Chef::Log.debug("#{new_resource} staging #{uri.path} to #{tempfile.path}")
FileUtils.cp(uri.path, tempfile.path)
- Chef::Provider::RemoteFile::Result.new(tempfile, nil, nil)
+ tempfile
end
end
diff --git a/lib/chef/provider/remote_file/result.rb b/lib/chef/provider/remote_file/result.rb
deleted file mode 100644
index dccb8e2222..0000000000
--- a/lib/chef/provider/remote_file/result.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Author:: Jesse Campbell (<hikeit@gmail.com>)
-# Author:: Lamont Granquist (<lamont@opscode.com>)
-# Copyright:: Copyright (c) 2013 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-class Chef
- class Provider
- class RemoteFile
- class Result
-
- attr_accessor :raw_file
- attr_accessor :etag
- attr_accessor :mtime
-
- def initialize(raw_file, etag, mtime)
- @raw_file = raw_file
- @etag = etag
- @mtime = mtime
- end
- end
- end
- end
-end
-
diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb
index 8fc66fc9a8..145de8173e 100644
--- a/lib/chef/providers.rb
+++ b/lib/chef/providers.rb
@@ -106,7 +106,6 @@ require 'chef/provider/remote_file/ftp'
require 'chef/provider/remote_file/http'
require 'chef/provider/remote_file/local_file'
require 'chef/provider/remote_file/fetcher'
-require 'chef/provider/remote_file/result'
require "chef/provider/lwrp_base"
require 'chef/provider/registry_key'