summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormarguerite <marguerite@pagerduty.com>2015-07-21 14:47:12 -0400
committermarguerite <marguerite@pagerduty.com>2015-07-21 15:35:58 -0400
commit577773bbb838a91fee53d1ad21dddfb5fd9dbd22 (patch)
treed41c35d6b3e35a786fd788914cc232f4abd2c31d /lib
parent2c4d7c7cf40346ca8236054901c023f35e1300c9 (diff)
downloadchef-577773bbb838a91fee53d1ad21dddfb5fd9dbd22.tar.gz
Interpolate `%{path}` in verify command
See chef/chef#3232
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/file/verification.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/resource/file/verification.rb b/lib/chef/resource/file/verification.rb
index f1ca0f1883..6be1f912fd 100644
--- a/lib/chef/resource/file/verification.rb
+++ b/lib/chef/resource/file/verification.rb
@@ -106,7 +106,9 @@ class Chef
# We reuse Chef::GuardInterpreter in order to support
# the same set of options that the not_if/only_if blocks do
def verify_command(path, opts)
- command = @command % {:file => path}
+ # First implementation interpolated `file`; docs & RFC claim `path`
+ # is interpolated. Until `file` can be deprecated, interpolate both.
+ command = @command % {:file => path, :path => path}
interpreter = Chef::GuardInterpreter.for_resource(@parent_resource, command, @command_opts)
interpreter.evaluate
end