Issue #16268 has been updated by Charlie Sharpsteen. Category changed from language to parser Status changed from Needs Decision to Duplicate Assignee deleted (eric sorenson) Keywords changed from dsl to selector hash_literal
Duplicate of #14301. This is a regression between 2.7.1 and 2.7.3 introduced by [3ac7aed](https://github.com/puppetlabs/puppet/commit/3ac7aed). ---------------------------------------- Bug #16268: Hash literals not allowed inside conditional block https://projects.puppetlabs.com/issues/16268#change-89192 * Author: Jochen Schalanda * Status: Duplicate * Priority: Normal * Assignee: * Category: parser * Target version: * Affected Puppet version: * Keywords: selector hash_literal * Branch: ---------------------------------------- The Puppet DSL currently doesn’t allow hash literals expressions being used as the value in a conditional block. Using a temporary variable which holds the value works, though. Non-working example: $test = undef ? { undef => { 'test' => 'success' }, default => 'foo', } notice($test) Result with Puppet 2.7.19: $ puppet apply conditional_hash.pp Could not parse for environment production: Syntax error at '{'; expected '}' at /tmp/conditional_hash.pp:2 on node localhost Working example: $my_hash = { 'test' => 'success' } $test = undef ? { undef => $my_hash, default => 'foo', } notice($test) Result: $ puppet apply conditional_hash2.pp notice: Scope(Class[main]): {"test"=>"success"} notice: Finished catalog run in 0.03 seconds -- 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
