diff options
author | Tim Smith <tsmith@chef.io> | 2018-01-04 10:15:17 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-01-04 10:15:17 -0800 |
commit | 19d77fc82232dbf46975a3c2b110a2dc99e508d2 (patch) | |
tree | 2671f999267a1b1473db35374d8003a8ef1f6e9d | |
parent | 2eeac94e91de7f48e7706115b9964cc6faece671 (diff) | |
download | chef-19d77fc82232dbf46975a3c2b110a2dc99e508d2.tar.gz |
Go back to requiring code in script resources and remove command entirely
I created FC110 to detect people using command in a script resource. It's incredibly rare and we were already raising in Chef 13 for this. We should just remove it entirely now.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/provider/script.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/script.rb | 12 |
2 files changed, 1 insertions, 15 deletions
diff --git a/lib/chef/provider/script.rb b/lib/chef/provider/script.rb index 4046b7c0dd..b54965be45 100644 --- a/lib/chef/provider/script.rb +++ b/lib/chef/provider/script.rb @@ -49,10 +49,6 @@ class Chef def load_current_resource super - # @todo Chef-13: change this to an exception - if code.nil? - Chef::Log.warn "#{new_resource}: No code attribute was given, resource does nothing, this behavior is deprecated and will be removed in Chef-13" - end end def action_run diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb index 5271fa0d96..62ce5140bd 100644 --- a/lib/chef/resource/script.rb +++ b/lib/chef/resource/script.rb @@ -29,17 +29,7 @@ class Chef class Script < Chef::Resource::Execute resource_name :script - # Chef-13: go back to using :name as the identity attr - # Chef-13: the command variable should be initialized to nil - - property :command, coerce: proc { |v| - # Chef-13: change this to raise if the user is trying to set a value here - Chef::Log.warn "Specifying command attribute on a script resource is a coding error, use the 'code' attribute, or the execute resource" - Chef::Log.warn "This attribute is deprecated and must be fixed or this code will fail on Chef 13" - v - } - - property :code, String + property :code, String, required: true property :interpreter, String property :flags, String property :default_guard_interpreter, default: :default |