Issue #3129 has been updated by James Turnbull.
Status changed from Investigating to Needs design decision
Assigned to changed from James Turnbull to Luke Kanies
<pre>
class sol {
notice("sol")
class net {
notice("net")
class bob {
notice("bob")
}
class 10 {
notice("10")
}
}
}
class one::two::three {
notice("one/two/three")
}
#class "one::two::3" {
#
# notice("one/two/3")
#}
class sol {
class 3 {
notice("3")
}
}
#include sol
#include net
#include 10
#include sol::net
#include "sol::net::10"
#include sol::net::bob
#include one::two::three
#include one::two::3
include sol::3
</pre>
The above manifests tries variations of this:
1. Nested classes with numeric classes:
<pre>
class one {
class 3 { }
}
<pre>
These work if quoted:
<pre>
include "one::3" { }
</pre>
But not if not quoted:
<pre>
include one::3.
</pre>
2. Fully-qualified classes:
<pre>
class one::3 {}
</pre>
<pre>
class "one::3" {}
</pre>
Where the second class is numeric - don't work quoted or not.
<pre>
Could not parse for environment production: Syntax error at 'sol::3' at
/tmp/number.pp:32
</pre>
So I am guessing this is related to the regex in CLASSREF & NAME in the lexer
but not sure what behaviour we should support. I am guessing if we support
numeric class names then we should support then we should support them nested.
Perhaps the lexer regex should be:
<pre>
%r{([a-z0-9][-\w]*)?(::[a-z0-9][-\w]*)+} => :CLASSNAME, # Require '::' in the
class name, else we'd compete with NAME
</pre>
This would allow example 1 above to work - quoted or unquoted.
Example 2 would still fail - not sure how to fix that? Luke/Markus?
----------------------------------------
Bug #3129: Problem using a number as as class name
http://projects.reductivelabs.com/issues/3129
Author: Mike Culbertson
Status: Needs design decision
Priority: Normal
Assigned to: Luke Kanies
Category: RAL
Target version: 0.25.5
Affected version: 0.25.3
Keywords:
Branch:
I've run into what looks like a bug when using a number as a class name in a
nested class. There are no errors while parsing the class itself, but when the
manifest gets to the point where I actually include the class, this happens:
<pre>
err: Could not parse for environment development: Syntax error at ':'; expected
'}' at /etc/puppet/development/modules/sol/manifests/init.pp:77
</pre>
The include line is:
<pre>
include sol::network::10
</pre>
If I double-quote the class name, the error does not occur. I've attached
debug+trace logs from puppetd, puppetmasterd and a (slightly redacted) copy of
the init.pp from the module in question. This is the only manifest in this
particular module. However, I do have numeric class names elsewhere in other
modules, and they all erorred out the same way until I quoted the class names,
so it does not appear to be unique to this module or class.
TIA
-Mike
--
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://reductivelabs.com/redmine/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.