Anyone have an implementation that allows you to evaluate the configs before they are committed to subversion? Too often, I''ll find that I missed a comma or whatnot and all of a sudden, puppetmaster can''t properly parse the configs anymore. I''d like to catch that before a commit. -- DK
On Wed, Feb 07, 2007 at 09:51:51AM -0800, Digant C Kasundra wrote:> Anyone have an implementation that allows you to evaluate the configs > before they are committed to subversion? Too often, I''ll find that I > missed a comma or whatnot and all of a sudden, puppetmaster can''t properly > parse the configs anymore. I''d like to catch that before a commit.You too, huh? I''ve considered writing a simple Ruby script that just uses the standard Puppet parser/etc to validate my manifests as far as reasonably possible. Naturally, I haven''t actually gotten around to it, but at least it''s on the todo list. - Matt -- I''m personally quite happy with one stable release every two years, and am of the opinion that trying to release more will mean we''ll have to rename the distro from "stable" to "wobbly". -- Scott Remnant on debian-devel
On Feb 7, 2007, at 3:50 PM, Matthew Palmer wrote:> On Wed, Feb 07, 2007 at 09:51:51AM -0800, Digant C Kasundra wrote: >> Anyone have an implementation that allows you to evaluate the configs >> before they are committed to subversion? Too often, I''ll find that I >> missed a comma or whatnot and all of a sudden, puppetmaster can''t >> properly >> parse the configs anymore. I''d like to catch that before a commit. > > You too, huh? I''ve considered writing a simple Ruby script that > just uses > the standard Puppet parser/etc to validate my manifests as far as > reasonably > possible. Naturally, I haven''t actually gotten around to it, but > at least > it''s on the todo list.Note that it should be possible to skip loading the entire Puppet source tree and just load the parser in order to do this syntax check, which would potentially be much faster. It''s probably worth looking into that for this kind of purpose. -- A child can go only so far in life without potty training. It is not mere coincidence that six of the last seven presidents were potty trained, not to mention nearly half of the nation''s state legislators. -- Dave Barry --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies wrote:> Note that it should be possible to skip loading the entire Puppet > source tree and just load the parser in order to do this syntax > check, which would potentially be much faster. It''s probably worth > looking into that for this kind of purpose.All: I''m working on this at the moment. If you are too, let me know. It looks like we ought to implement a parse mode that doesn''t do imports, because in the pre-commit hook we don''t have access to files on the filesystem. Peter
On Feb 7, 2007, at 6:53 PM, Peter Abrahamsen wrote:> > All: I''m working on this at the moment. If you are too, let me > know. It > looks like we ought to implement a parse mode that doesn''t do imports, > because in the pre-commit hook we don''t have access to files on the > filesystem.It''s probably a good idea to make sure that this works when the code is fed on stdin, too, maybe even to default to it. That way you don''t have to handle temp files or anything. I don''t remember how svn does commit-hooks, but this might make it somewhat easier. -- The difference between scientists and engineers is that when engineers screw up, people die. -- Professor Orthlieb --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com