Skip to content

Commit 6c7da72

Browse files
author
Travis Fields
committed
Fix validate_cmd, previous addition of SystemCallError only works for Puppet 3.7, previous version throw different exception. Wrapping in generic Exception catch all
1 parent 385f009 commit 6c7da72

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/puppet/parser/functions/validate_cmd.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ module Puppet::Parser::Functions
4242
rescue Puppet::ExecutionFailure => detail
4343
msg += "\n#{detail}"
4444
raise Puppet::ParseError, msg
45-
rescue SystemCallError => detail
46-
msg += "\nWin32::Process::SystemCallError #{detail}"
45+
rescue Exception => detail
46+
msg += "\n#{detail.class.name} #{detail}"
4747
raise Puppet::ParseError, msg
4848
ensure
4949
tmpfile.unlink

spec/acceptance/validate_cmd_spec.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
validate_cmd($one,$two,"aoeu is dvorak")
4141
EOS
4242

43-
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/aoeu is dvorak/)
43+
apply_manifest(pp, :expect_failures => true) do |output|
44+
expect(output.stderr).to match(/aoeu is dvorak/)
45+
end
4446
end
4547
end
4648
describe 'failure' do

0 commit comments

Comments
 (0)