diff options
-rw-r--r-- | lib/chef/resource/cookbook_file.rb | 21 | ||||
-rw-r--r-- | lib/chef/resource/file.rb | 1 |
2 files changed, 3 insertions, 19 deletions
diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb index 785cf693be..8315e3f8b8 100644 --- a/lib/chef/resource/cookbook_file.rb +++ b/lib/chef/resource/cookbook_file.rb @@ -25,25 +25,8 @@ require "chef/mixin/securable" class Chef class Resource class CookbookFile < Chef::Resource::File - include Chef::Mixin::Securable - - default_action :create - - def initialize(name, run_context = nil) - super - @provider = Chef::Provider::CookbookFile - @source = ::File.basename(name) - @cookbook = nil - end - - def source(source_filename = nil) - set_or_return(:source, source_filename, :kind_of => [ String, Array ]) - end - - def cookbook(cookbook_name = nil) - set_or_return(:cookbook, cookbook_name, :kind_of => String) - end - + property :source, [ String, Array ], default: lazy { ::File.basename(path) }, desired_state: false + property :cookbook_name, [ String, Array ], desired_state: false end end end diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb index 7088e7613e..d17d7fb323 100644 --- a/lib/chef/resource/file.rb +++ b/lib/chef/resource/file.rb @@ -50,6 +50,7 @@ class Chef allowed_actions :create, :delete, :touch, :create_if_missing property :path, String, name_property: true, identity: true + property :atomic_update, [ true, false ], desired_state: false, default: lazy { |r| r.docker? && r.special_docker_files?(r.path) ? false : Chef::Config[:file_atomic_update] } property :backup, [ Integer, false ], desired_state: false, default: 5 property :checksum, [ /^[a-zA-Z0-9]{64}$/, nil ] |