Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validate_cmd, previous addition of SystemCallError only works for Puppet 3.7, previous version throw different exception. Wrapping in generic Exception catch all #349

Merged
merged 1 commit into from
Oct 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/puppet/parser/functions/validate_cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ module Puppet::Parser::Functions
rescue Puppet::ExecutionFailure => detail
msg += "\n#{detail}"
raise Puppet::ParseError, msg
rescue SystemCallError => detail
msg += "\nWin32::Process::SystemCallError #{detail}"
rescue Exception => detail
msg += "\n#{detail.class.name} #{detail}"
raise Puppet::ParseError, msg
ensure
tmpfile.unlink
Expand Down
4 changes: 3 additions & 1 deletion spec/acceptance/validate_cmd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
validate_cmd($one,$two,"aoeu is dvorak")
EOS

expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/aoeu is dvorak/)
apply_manifest(pp, :expect_failures => true) do |output|
expect(output.stderr).to match(/aoeu is dvorak/)
end
end
end
describe 'failure' do
Expand Down