summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-05-30 15:26:40 -0700
committerdanielsdeleo <dan@opscode.com>2013-05-31 09:52:01 -0700
commitd3dc63db74a6fbe4728bc94ba9d8c3c6f7b5e752 (patch)
treedd7c50d210d8b5b43125fba248cba2a54bede69c /lib
parentade637eca728eb264bcab4eb8da840743475e88d (diff)
downloadchef-d3dc63db74a6fbe4728bc94ba9d8c3c6f7b5e752.tar.gz
remove unused remote file util class
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/remote_file/content.rb9
-rw-r--r--lib/chef/provider/remote_file/ftp.rb1
-rw-r--r--lib/chef/provider/remote_file/util.rb43
-rw-r--r--lib/chef/providers.rb1
4 files changed, 2 insertions, 52 deletions
diff --git a/lib/chef/provider/remote_file/content.rb b/lib/chef/provider/remote_file/content.rb
index 586f75f5bc..d75ee735a1 100644
--- a/lib/chef/provider/remote_file/content.rb
+++ b/lib/chef/provider/remote_file/content.rb
@@ -21,15 +21,12 @@ require 'rest_client'
require 'uri'
require 'tempfile'
require 'chef/file_content_management/content_base'
-require 'chef/provider/remote_file/util'
class Chef
class Provider
class RemoteFile
class Content < Chef::FileContentManagement::ContentBase
- attr_reader :raw_file_source
-
private
def file_for_provider
@@ -39,13 +36,11 @@ class Chef
Chef::Log.debug("#{@new_resource} checksum matches target checksum (#{@new_resource.checksum}) - not updating")
else
sources = @new_resource.source
- raw_file, @raw_file_source = try_multiple_sources(sources)
+ raw_file = try_multiple_sources(sources)
end
raw_file
end
- private
-
# Given an array of source uris, iterate through them until one does not fail
def try_multiple_sources(sources)
sources = sources.dup
@@ -62,7 +57,7 @@ class Chef
raise e
end
end
- return raw_file, Chef::Provider::RemoteFile::Util.uri_for_cache(uri)
+ raw_file
end
# Given a source uri, return a Tempfile, or a File that acts like a Tempfile (close! method)
diff --git a/lib/chef/provider/remote_file/ftp.rb b/lib/chef/provider/remote_file/ftp.rb
index f772d19cc9..865667a31c 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/util'
require 'chef/provider/remote_file/result'
require 'chef/file_content_management/tempfile'
diff --git a/lib/chef/provider/remote_file/util.rb b/lib/chef/provider/remote_file/util.rb
deleted file mode 100644
index 6a6b71e8e0..0000000000
--- a/lib/chef/provider/remote_file/util.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Author:: Jesse Campbell (<hikeit@gmail.com>)
-# Author:: Lamont Granquist (<lamont@opscode.com>)
-# Copyright:: Copyright (c) 2013 Jesse Campbell
-# 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 Util
- def self.uri_for_cache(uri)
- sanitized_uri(uri).to_s
- end
-
- def self.uri_matches_string?(u1, u2)
- # we store sanitiszed uris, so have to compare sanitized uris
- return false if u1.nil? || u2.nil?
- sanitized_uri(u1).to_s == u2
- end
-
- def self.sanitized_uri(uri)
- uri_dup = uri.dup
- uri_dup.password = "********" if uri_dup.userinfo
- uri_dup
- end
- end
- end
- end
-end
-
diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb
index 9ecdee322a..8fc66fc9a8 100644
--- a/lib/chef/providers.rb
+++ b/lib/chef/providers.rb
@@ -107,7 +107,6 @@ 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/remote_file/util'
require "chef/provider/lwrp_base"
require 'chef/provider/registry_key'