Created
June 26, 2013 15:00
-
-
Save deanwilson/5868103 to your computer and use it in GitHub Desktop.
puppet parser validate returns zero on nonexistent file (http://projects.puppetlabs.com/issues/15494)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # half a fix | |
| $ git diff ./lib/puppet/face/parser.rb | |
| diff --git a/lib/puppet/face/parser.rb b/lib/puppet/face/parser.rb | |
| index 3242fac..93642f7 100644 | |
| --- a/lib/puppet/face/parser.rb | |
| +++ b/lib/puppet/face/parser.rb | |
| @@ -42,8 +42,12 @@ Puppet::Face.define(:parser, '0.0.1') do | |
| end | |
| end | |
| files.each do |file| | |
| - Puppet[:manifest] = file | |
| - Puppet::Node::Environment.new(Puppet[:environment]).known_resource_types.clear | |
| + if File.readable?( file ) | |
| + Puppet[:manifest] = file | |
| + Puppet::Node::Environment.new(Puppet[:environment]).known_resource_types.clear | |
| + else | |
| + puts "Can't access #{file}" | |
| + end | |
| end | |
| nil | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment