Skip to main content

NotifiesActionNotSymbol

The department is: NotifiesActionNotSymbol

The full name of the cop is: Chef/Correctness/NotifiesActionNotSymbol

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

When notifying or subscribing actions within a resource the action should always be a symbol. In Chef Infra Client releases before 14.0, this may result in double notification.

Examples

incorrect

execute 'some command' do
  notifies 'restart', 'service[httpd]', 'delayed'
end

execute 'some command' do
  subscribes 'restart', 'service[httpd]', 'delayed'
end

correct

execute 'some command' do
  notifies :restart, 'service[httpd]', 'delayed'
end

execute 'some command' do
  subscribes :restart, 'service[httpd]', 'delayed'
end

Configurable attributes

NameDefault valueConfigurable values
Version Added5.10.0String
Include
    Array

    Thank you for your feedback!

    ×









    Search Results