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

This commit is contained in:
Travis Fields 2014-10-29 20:03:07 -07:00
parent 385f009488
commit 6c7da72c0f
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -40,7 +40,9 @@ describe 'validate_cmd function', :unless => UNSUPPORTED_PLATFORMS.include?(fact
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