Issue #14301 has been updated by Kelsey Hightower.
Status changed from Investigating to Accepted
Assignee deleted (Kelsey Hightower)
I was able to reproduce this with the following manifest:
# bug14301_hash.pp
$heroes = $enemy ? {
'Apocalypse' => { green => "Hulk", god => "Thor" },
default => { funny => "Iron Man", leader => "Captain America" },
}
The error:
$ puppet apply bug14301_hash.pp
Could not parse for environment production: Syntax error at '{'; expected
'}' at /Users/kelseyhightower/bug14301_hash.pp:2 on node ...
Assigning an array or string does work:
`bug14301_array.pp`
$heroes = $enemy ? {
'Apocalypse' => [ "Hulk", "Thor" ],
default => [ "Iron Man", "Captain America"],
}
`bug14301_string.pp`
$heroes = $enemy ? {
'Apocalypse' => "Hulk",
default => "Captain America",
}
----------------------------------------
Bug #14301: Hashes can not be used in selectors (upgrading from 2.7.1->2.7.14)
https://projects.puppetlabs.com/issues/14301#change-62060
Author: Kristian Kostecky
Status: Accepted
Priority: Normal
Assignee:
Category: server
Target version:
Affected Puppet version: 2.7.14
Keywords:
Branch:
After upgrading from puppet 2.7.1 -> 2.7.14, I noticed that all the selectors
that assigned hashes caused a parse error. I re-wrote them as if conditionals
to bypass the issue, but I believe this is a bug.
Example:
$test = $fqdn ? {
'test' => { 'test' => 'test', 't' => 't' },
default => { 'test' => 'test', 't' => 't' },
}
Gives:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could
not parse for environment production: Syntax error at '{'; expected '}' at
XXXXXX
--
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.