template verify variable name mismatch #3232

Closed
Tech356 opened this Issue Apr 16, 2015 · 1 comment

Projects

None yet

2 participants

@Tech356
Tech356 commented Apr 16, 2015

RFC 27 states

The path to the temporary file with the proposed content will be available
by using Ruby's sprinf formatting:

"%{path}"

And the documentation show an example

template "/etc/nginx.conf" do
  verify "nginx -t -c %{path}"
end

But the code gives file instead of path

def verify_command(path, opts)
    command = @command % {:file => path}
    interpreter = Chef::GuardInterpreter.for_resource(@parent_resource, command, @command_opts)
    interpreter.evaluate
end
@stevendanna
Member

Thanks @Tech356. Let's add :path and keep :file to avoid breaking anyone else who managed to figure out the right option. Sorry about this.

@Tech356 Tech356 closed this Jul 28, 2015
@natewalck natewalck added a commit to natewalck/chef that referenced this issue Aug 11, 2015
@margueritepd @natewalck margueritepd + natewalck Interpolate `%{path}` in verify command 7124921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment