diff options
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! |