Chef/Correctness/NotifiesActionNotSymbol
The Cookstyle cops department: Chef/Correctness
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Enabled | Yes | All 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
Name | Default value | Configurable values |
---|---|---|
Version Added | 5.10.0 | String |
Include | Array |