diff options
author | danielsdeleo <dan@opscode.com> | 2013-05-23 15:26:14 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-05-24 08:48:35 -0700 |
commit | 0ddcb950864f16c5f218d389293d7b2fd91be361 (patch) | |
tree | d405d4ead0fb22741109b3477365af18506a8b03 /lib/chef/provider/remote_file | |
parent | a8283cb6e7146688aafa63208c90df84143b130a (diff) | |
download | chef-0ddcb950864f16c5f218d389293d7b2fd91be361.tar.gz |
remove obsolete conditional fetch code
Removes conditional fetch logic based on the old (and already removed)
design where the remote file provider set conditional fetch data
directly on the remote file resources. For now this is replaced with
stub code that results in the file being fetched unconditionally.
Diffstat (limited to 'lib/chef/provider/remote_file')
-rw-r--r-- | lib/chef/provider/remote_file/ftp.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/chef/provider/remote_file/ftp.rb b/lib/chef/provider/remote_file/ftp.rb index 47507c864d..d7f0527e33 100644 --- a/lib/chef/provider/remote_file/ftp.rb +++ b/lib/chef/provider/remote_file/ftp.rb @@ -37,11 +37,6 @@ class Chef @uri = uri @new_resource = new_resource @current_resource = current_resource - if current_resource.source && Chef::Provider::RemoteFile::Util.uri_matches_string?(uri, current_resource.source[0]) - if current_resource.use_last_modified && current_resource.last_modified - @last_modified = current_resource.last_modified - end - end validate_typecode! validate_path! end @@ -95,7 +90,7 @@ class Chef ENV['SOCKS_SERVER'] = proxy_uri(@uri).to_s connect mtime = ftp.mtime(filename) - tempfile = if mtime && @last_modified && mtime.to_i <= @last_modified.to_i + tempfile = if use_conditional_fetch? and local_up_to_date?(mtime) nil else get @@ -112,6 +107,15 @@ class Chef @ftp ||= Net::FTP.new end + def local_up_to_date?(remote_mtime) + # TODO: stub code + false + end + + def use_conditional_fetch? + new_resource.use_last_modified + end + private def validate_typecode! |