Skip to content

Instantly share code, notes, and snippets.

@deanwilson
Created June 26, 2013 15:00
Show Gist options
  • Select an option

  • Save deanwilson/5868103 to your computer and use it in GitHub Desktop.

Select an option

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)
# 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