guard-puppet-lint icon indicating copy to clipboard operation
guard-puppet-lint copied to clipboard

notifications of failing parser do not work

Open taschik opened this issue 11 years ago • 1 comments

Hi!

I just created a small fix that allows to send notifications of a not compiling catalog for Puppet 3.0.1. You need to add the redirection of stderr to stdout and adapt your string to strip out the "Error: ..." message.

    if options[:syntax_check]
      parser_messages = `puppet parser validate  #{file} --color=false 2>&1`.split("\n")
      parser_messages.reject! { |s| s =~ /puppet help parser validate/ }
      parser_messages.map! { |s| s.gsub 'Error: Could not parse for environment production:', '' }
      messages += prepend_filename(parser_messages, file)
    end

Best Regards,

Daniel

taschik avatar Oct 25 '12 18:10 taschik

Can you make a pull request for me to merge?

alister avatar Oct 25 '12 20:10 alister