detecting manifest parser version

41 views
Skip to first unread message

Corey Osman

unread,
Apr 21, 2015, 2:59:50 PM4/21/15
to Puppet Dev
Is there a better way to detect which parser a manifest is using than what I have come up with below?





Corey


Henrik Lindberg

unread,
Apr 23, 2015, 9:44:45 AM4/23/15
to puppe...@googlegroups.com
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+...@googlegroups.com
> <mailto:puppet-dev+...@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/

Corey Osman

unread,
Apr 23, 2015, 3:36:25 PM4/23/15
to puppe...@googlegroups.com
Yea, since I don't actually run evaluation at this point I only need a manifest to parse.  

I am using this in my project: http://github.com/logicminds/puppet-retrospec if you are curious.   I am thinking I may need to hot swap parser versions during manifest inspection in order to produce the same output for future parser code.

Thanks for taking the time to respond.  I will have a look at the catalog preview tool which I assume is useful for comparing 4.x catalogs with 3.x catalogs.


Corey

Henrik Lindberg

unread,
Apr 23, 2015, 7:05:31 PM4/23/15
to puppe...@googlegroups.com
On 2015-23-04 21:36, Corey Osman wrote:
> Yea, since I don't actually run evaluation at this point I only need a
> manifest to parse.
>
> I am using this in my project:
> http://github.com/logicminds/puppet-retrospec if you are curious. I am
> thinking I may need to hot swap parser versions during manifest
> inspection in order to produce the same output for future parser code..
>
> Thanks for taking the time to respond. I will have a look at the
> catalog preview tool which I assume is useful for comparing 4.x catalogs
> with 3.x catalogs.
>
Yes, as well as 4x catalogs with eachother. This will be part of PE 3.8
release, and it is a PE only feature.

- henrik


Reply all
Reply to author
Forward
0 new messages