Skip to main content

ExecuteRelativeCreatesWithoutCwd

All Cookstyle Cops


The department is: Chef/Deprecations

The full name of the cop is: Chef/Deprecations/ExecuteRelativeCreatesWithoutCwd


Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNoAll Versions

In Chef Infra Client 13 and later you must either specific an absolute path when using the execute resource’s creates property or also use the cwd property.

Examples

incorrect

execute 'some_cmd' do
  creates 'something'
end

correct

execute 'some_cmd' do
  creates '/tmp/something'
end

execute 'some_cmd' do
  creates 'something'
  cwd '/tmp/'
end

Configurable attributes

NameDefault valueConfigurable values
Version Added6.17.0String
Exclude
  • **/metadata.rb
  • **/attributes/*.rb
  • **/Berksfile
Array

Was this page helpful?