Issue #14704 has been updated by Henrik Lindberg.
Although possible to fix this in the future parser (I tried - it works) (not
sure it is doable with a reasonable effort in the 3.2 regular parser) the
question is if it is worth it.
However - an upper case word will continue to be a qualified reference to a
type. It can be made to work but only for existing types. (Compare to Ruby,
where you can't use
a reference to a class / constant that does not exist and use that as a key).
Thus if a user tries e.g. `{Lollipop => 'candy' } it will result in an error
that the type `Lollipop` is unknown, but
it would work to do `{File => 'used to get out of jail'}` since `File` exists.
The "fix" for this is to give a better error message - "Illegal hash key - a
QualifiedReference is not a valid hash key". This can be done easily in the
--parser future of 3.x.
I am reluctant to make hash-key a special case and turn the QualifiedReference
into a string since other future work makes use of QualifiedReference to mean
reference to existing type (type in
the general sense, not just resource types).
In any case - this is not a bug, it was not intended to work.
Suggest either closing this issue as "won't fix" and possibly open new issues
for "allow any object as hash key", and "improve error message for illegal hash
keys",
or modify this issue to be about "better error message" and change it to a
feature.
----------------------------------------
Bug #14704: Capitalised hash keys do not parse
https://projects.puppetlabs.com/issues/14704#change-92522
* Author: James Turnbull
* Status: Accepted
* Priority: Normal
* Assignee: Charlie Sharpsteen
* Category: parser
* Target version:
* Affected Puppet version: 2.7.14
* Keywords: hash key capitalised parse error goalie_06_28_2012 customer
* Branch:
----------------------------------------
Hash keys with leading capitals do not parse.
This does not parse:
<pre>
$packages = {
Mysql-cluster => {version => '7.1.21-1.sles11'}
}
</pre>
This parses:
<pre>
$packages = {
mysql-cluster => {version => '7.1.21-1.sles11'}
}
</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 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.