On 2015-21-04 20:59, Corey Osman wrote:
Is there a better way to detect which parser a manifest is using than
what I have come up with below?


https://gist.github.com/logicminds/d3f795f4fa28ed8d0be6


Your code basically runs puppet parser validate with or without --parser future afaict

Result of validation:

current | future | meaning
------- | ------ | -------
Y       | Y      | ambiguous, evaluation may fail in either
Y       | N      | most likely not intended for use with future parser
N       | Y      | most likely intended for future parser
N       | N      | manifest is universally broken

Note that puppet validate only finds static parsing problems (lexical, syntactical, and a few semantic errors), but not evaluation problems. If your intent is simply to rule out those manifests that could not possibly be used with the current parser, then your code is good. For other use cases, there is probably too much uncertainty to be of real practical value in a general way (maybe it is still useful to your code base because you can make certain assumptions).

Also note that Puppet Enterprise 3.8.0 contains a Catalog Preview tool that can help more precisely validation and point to evaluation problems. This tool is only available for Puppet Enterprise users.

regards
- henrik



Corey


--
You received this message because you are subscribed to the Google
Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to puppet-dev+unsubscr...@googlegroups.com
<mailto:puppet-dev+unsubscr...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-dev/B04ECC75-1BB7-451C-9409-B7197C6D9FD2%40logicminds.biz
<https://groups.google.com/d/msgid/puppet-dev/B04ECC75-1BB7-451C-9409-B7197C6D9FD2%40logicminds.biz?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/mhasvt%24v8o%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to