diff options
Diffstat (limited to 'lib/chef/provider/dsc_script.rb')
-rw-r--r-- | lib/chef/provider/dsc_script.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb index 122b7e6198..a1bb9c63a7 100644 --- a/lib/chef/provider/dsc_script.rb +++ b/lib/chef/provider/dsc_script.rb @@ -98,7 +98,9 @@ class Chef if @dsc_resource.command generator.configuration_document_from_script_path(@dsc_resource.command, configuration_name, configuration_flags, shellout_flags) else - generator.configuration_document_from_script_code(@dsc_resource.code, configuration_flags, shellout_flags) + # If code is also not provided, we mimic what the other script resources do (execute nothing) + Chef::Log.warn("Neither code or command were provided for dsc_resource[#{@dsc_resource.name}].") unless @dsc_resource.code + generator.configuration_document_from_script_code(@dsc_resource.code || '', configuration_flags, shellout_flags) end end |