On Nov 1, 10:45 pm, Nan Liu <n...@puppetlabs.com> wrote:
> On Tue, Nov 1, 2011 at 12:50 PM, Rob Terhaar <rob...@robbyt.net> wrote:
> > Hi All,
>
> > Does anyone have a good git pre-commit hook that's compatible with
> > Puppet 2.7? The example pre-commit hook on the PuppetLabs wiki[1] no
> > longer works, because the puppet binary no longer seems to accept
> > stdin.
>
> In 2.7 'puppet manifest.pp' is no longer supported (which is puppet
> apply manifest.pp), and --parseonly option has it's own face which you
> can find out more about via:
> puppet help parser
>
> I think you just need to change from:
> syntax_check="puppet --color=false --confdir=/tmp --vardir=/tmp
> --parseonly --ignoreimport"
>
> syntax_check="puppet parser validate"
>
> Thanks,
>
> Nan

Thanks Nan,

I noticed that the syntax for the puppet manifest validator changed,
however what has also changed is that `puppet parser validate` does
not accept data via stdin.

(i've created test.pp with a syntax error)
`cat test.pp | puppet parser validate`
incorrectly returns:
notice: No manifest specified. Validating the default manifest /home/
rterhaar/.puppet/manifests/site.pp

The only way to parse manifests is via:
`puppet parser validate test.pp`
correctly returns:
err: Could not parse for environment production: Syntax error at '}'
at /srv/home/rterhaar/test.pp:1


So, can any UNIX gurus out there tell me if this is safe to use
instead?
`cat test.pp | puppet parser validate /dev/fd/0`


And, is this a bug?




-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to