summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorAdam Edwards <adamed@opscode.com>2014-08-28 06:10:48 -0700
committerBryan McLellan <btm@loftninjas.org>2014-09-03 13:57:38 -0400
commit98f7b430ce3dfea34561f75d6aba3684184ead90 (patch)
tree0e4ac2eb3a502caa7267ce69443ee810bb058194 /lib/chef/provider
parent54bf3fb6c339154eb24d68458ff961a34e8dd46b (diff)
downloadchef-98f7b430ce3dfea34561f75d6aba3684184ead90.tar.gz
DSC: Added test for dsc_script provider
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/dsc_script.rb4
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