summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-02-26 15:22:08 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-02-28 11:19:49 -0800
commit7ee1d70692864b4496176acac9e6ed8196aa53cb (patch)
treef149e79f9b38c2923dc1f69857d53386cc6720ce /lib
parentec52255d450f04055ae3a558043874f8eae97cfa (diff)
downloadchef-7ee1d70692864b4496176acac9e6ed8196aa53cb.tar.gz
Chef 13: script resources (and e.g. bash) require 'code' property
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/script.rb30
1 files changed, 4 insertions, 26 deletions
diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb
index e1d71c2924..5039e2d8fe 100644
--- a/lib/chef/resource/script.rb
+++ b/lib/chef/resource/script.rb
@@ -28,12 +28,10 @@ class Chef
def initialize(name, run_context = nil)
super
@command = nil
- @code = nil
- @interpreter = nil
- @flags = nil
@default_guard_interpreter = :default
end
+ # FIXME: remove this and use an execute sub-resource instead of inheriting from Execute
def command(arg = nil)
unless arg.nil?
raise Chef::Exceptions::Script, "Do not use the command attribute on a #{resource_name} resource, use the 'code' attribute instead."
@@ -41,29 +39,9 @@ class Chef
super
end
- def code(arg = nil)
- set_or_return(
- :code,
- arg,
- :kind_of => [ String ]
- )
- end
-
- def interpreter(arg = nil)
- set_or_return(
- :interpreter,
- arg,
- :kind_of => [ String ]
- )
- end
-
- def flags(arg = nil)
- set_or_return(
- :flags,
- arg,
- :kind_of => [ String ]
- )
- end
+ property :code, String, required: true
+ property :interpreter, String
+ property :flags, String
end
end