Skip to content

Commit aba1adf

Browse files
committed
Merge pull request #231 from DataDog/olivielpeau/support-why-run
[why-run] Skip dd-handler recipe in why-run mode
2 parents 234526f + 94bdeed commit aba1adf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

recipes/dd-handler.rb

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
# limitations under the License.
1818
#
1919

20+
if Chef::Config[:why_run]
21+
# chef_handler 1.1 needs us to require datadog handler's file,
22+
# which makes why-run runs fail when chef-handler-datadog is not installed,
23+
# so skip the recipe when in why-run mode until we can use chef_handler 1.2
24+
Chef::Log.warn('Running in why-run mode, skipping dd-handler')
25+
return
26+
end
27+
2028
include_recipe 'chef_handler'
2129
ENV['DATADOG_HOST'] = node['datadog']['url']
2230

0 commit comments

Comments
 (0)