Interpolate `%{path}` in verify command #3693

Merged
merged 2 commits into from Jul 23, 2015

Projects

None yet

7 participants

@margueritepd
Contributor
@coderanger
Contributor

Can you add a comment indicating why there are two? Maybe that would give us a mild chance of remembering to remove the old one for Chef 13.

@ranjib
Member
ranjib commented Jul 21, 2015

@coderanger RFC says the variable name should be path. current implementation uses file . Keeping file as it is will ensure nothing breaks downstream

@stevendanna
Member

@ranjib I believe @coderanger was asking for a comment in the code for people who come across it later. I'm ๐Ÿ‘ on having a code comment about why we have two.

@coderanger
Contributor

Yes, we can't remove file until Chef 13, but we should eventually revisit to clean this up.

@ranjib
Member
ranjib commented Jul 21, 2015

@margueritepd that helper method name should be something different, in itself its not a test. may be platform_specific_command ?
@coderanger i cant think of a way to throw deprecation warning for file usage, else it would have helped..
๐Ÿ‘

@ranjib
Member
ranjib commented Jul 21, 2015

@stevendanna ah .. got it now

@coderanger
Contributor
Chef::Log.deprecate('%{file} is deprecated in favor of %{path}') if @command.include?('%{file}')

or something like that.

@margueritepd
Contributor

@coderanger comment and deprecation warning added, tests updated :)

I didn't use Chef::Log.deprecation because that throws an error apparently.

@mcquin
Contributor
mcquin commented Jul 21, 2015

@margueritepd there is a configuration option for treating deprecation warnings as errors. It's best to use Chef::Log.deprecation.

@margueritepd margueritepd Warn about deprecation `%{file}` interpolation in verify command
e330c30
@margueritepd
Contributor

@mcquin back to using deprecation!

@mcquin
Contributor
mcquin commented Jul 22, 2015

๐Ÿ‘

@thommay thommay merged commit 5daf096 into chef:master Jul 23, 2015

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@margueritepd margueritepd deleted the unknown repository branch Jul 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment