Deprecation: Verify File Expansion (CHEF-7)

[edit on GitHub]

The verify metaproperty allows the user to specify a {path} variable that is expanded to the path of the file to be verified. Previously, it was possible to use {file} as the variable, but that is now deprecated.

The {file} expansion was deprecated in Chef Client 12.5, and will be removed in Chef Client 13.

Example

file '/etc/nginx.conf' do
  verify 'nginx -t -c %{file}'
end

Remediation

Replace %{file} with %{path}:

file '/etc/nginx.conf' do
  verify 'nginx -t -c %{path}'
end

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/deprecations_verify_file/