Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Chef 13: Alert if someone uses #{file} in verify #585

Closed
tas50 opened this issue Apr 10, 2017 · 1 comment
Closed

Chef 13: Alert if someone uses #{file} in verify #585

tas50 opened this issue Apr 10, 2017 · 1 comment

Comments

@tas50
Copy link
Contributor

tas50 commented Apr 10, 2017

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 12.5, and will be removed in Chef 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
@tas50
Copy link
Contributor Author

tas50 commented Aug 28, 2019

Tracking this in chef/cookstyle#95

@tas50 tas50 closed this as completed Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant