Issue #15910 has been updated by eric sorenson. Status changed from Unreviewed to Accepted Target version set to 3.x Keywords set to dsl
Marking this 'accepted' because the bug report is true; we should visit this along with other DSL normalization issues in the 3.x series. ---------------------------------------- Bug #15910: Arithmetic expressions not allowed inside conditional block https://projects.puppetlabs.com/issues/15910#change-69588 Author: Jochen Schalanda Status: Accepted Priority: Normal Assignee: Pieter van de Bruggen Category: Target version: 3.x Affected Puppet version: Keywords: dsl Branch: The Puppet DSL currently doesn't allow arithmetic expressions being used as the value in a conditional block. Using a temporary variable which holds the value or using @inline_template@ works but isn't very elegant. Example: <pre> $number = 1 $test = undef ? { undef => 2*$number, default => 'foo', } notice($test) </pre> Actual result with Puppet 2.7.17: <pre> $ puppet apply conditional_arithmetic.pp Could not parse for environment production: Syntax error at '*'; expected '}' at /tmp/conditional_arithmetic.pp:4 on node localhost </pre> Expected result: <pre> $ puppet apply conditional_arithmetic.pp notice: Scope(Class[main]): 2 notice: Finished catalog run in 0.03 seconds </pre> -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
