Jira (PUP-11813) Parenthesized expression causes EPP template validation failures
Title: Message Title Henrik Lindberg commented on PUP-11813 Re: Parenthesized _expression_ causes EPP template validation failures The validation and transformation of the AST that comes back from the parser is probably where the problem is. It may naively look for "Something followed by parentheses" and it finds TEXT PARENTHESIZED_EXPRESSION. It should just let that pass as it cannot possibly be the start of a parameterized EPP. Add Comment This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.483957.1680802564000.13261.1684142520020%40Atlassian.JIRA.
Jira (PUP-11813) Parenthesized expression causes EPP template validation failures
Title: Message Title Tony Vu updated an issue Puppet / PUP-11813 Parenthesized _expression_ causes EPP template validation failures Change By: Tony Vu Labels: needs-validation Add Comment This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.483957.1680802564000.6568.1681849980019%40Atlassian.JIRA.
Jira (PUP-11813) Parenthesized expression causes EPP template validation failures
Title: Message Title Torbjörn Lönnemark commented on PUP-11813 Re: Parenthesized _expression_ causes EPP template validation failures Presence of preceeding content is what triggers it, but I would expect code like this to work anywhere within a template file. When you generate e.g. a configuration file using a template you will usually have some content before and after any embedded Puppet code. For example, this works: [main] config_option1 = true config_option2 = <%= $param %> config_option3 = false Now, if we want to emit multiple lines based on the result of an _expression_ (which needs to be parenthesized so we can call each on it): [main] config_option1 = true <% ([4] + [7, 8, 9]).each |$x| { -%> config_option_<%= $x %> = false <% } -%> config_option3 = false (the values
Jira (PUP-11813) Parenthesized expression causes EPP template validation failures
Title: Message Title Josh Cooper commented on PUP-11813 Re: Parenthesized _expression_ causes EPP template validation failures Torbjörn Lönnemark thanks for letting us know. Note the leading comment is causing validation to fail. If you remove # any content then epp validation succeeds: ~/work/puppet 7.x* ❯ cat epp.pp <% ([1, 2, 3] + [7, 8, 9]).each |$x| { -%> <%= $x %> <% } -%> ~/work/puppet 7.x* ❯ bx puppet epp validate epp.pp ~/work/puppet 7.x* ❯ echo $? 0 Similary, if you remove the comment from:
Jira (PUP-11813) Parenthesized expression causes EPP template validation failures
Title: Message Title Torbjörn Lönnemark created an issue Puppet / PUP-11813 Parenthesized _expression_ causes EPP template validation failures Issue Type: Bug Assignee: Unassigned Created: 2023/04/06 10:36 AM Priority: Normal Reporter: Torbjörn Lönnemark Puppet Version: 7.23.0 The following EPP template: # any content <% ([1, 2, 3] + [7, 8, 9]).each |$x| { -%> <%= $x %> <% } -%> fails validation with: $ puppet epp validate test.pp