Skip to main content

Chef/Deprecations/LogResourceNotifications

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNo15.8+

In Chef Infra Client 16 the log resource no longer notifies when logging so notifications should not be triggered from log resources. Use the notify_group resource introduced in Chef Infra Client 15.8 instead to aggregate notifications.

Examples

incorrect

template '/etc/foo' do
  source 'bar.erb'
  notifies :write, 'log[Aggregate notifications using a single log resource]', :immediately
end

log 'Aggregate notifications using a single log resource' do
  notifies :restart, 'service[foo]', :delayed
end

correct

template '/etc/foo' do
  source 'bar.erb'
  notifies :run, 'notify_group[Aggregate notifications using a single notify_group resource]', :immediately
end

notify_group 'Aggregate notifications using a single notify_group resource' do
  notifies :restart, 'service[foo]', :delayed
end

Configurable attributes

NameDefault valueConfigurable values
Version Added6.0.0String
Include
    Array

    Thank you for your feedback!

    ×









    Search Results