Issue #21891 has been updated by Charlie Sharpsteen.
Status changed from Unreviewed to Closed
Assignee set to Charlie Sharpsteen
Using a hyphen in class names is still accepted by the parser:
<pre>
class foo-bar {
notify{"hai":}
}
include foo-bar
</pre>
Running the above manifest through `puppet apply` still works:
<pre>
$ puppet apply foo.pp
Notice: hai
Notice: /Stage[main]/Foo-bar/Notify[hai]/message: defined 'message' as 'hai'
Notice: Finished catalog run in 0.15 seconds
</pre>
However, the use of hyphens in class names is definitely depreciated and will
become invalidated soon. If you apply (or validate) the manifest using the
experimental future parser, a depreciation warning will be issued:
<pre>
$ puppet apply --parser=future foo.pp
Warning: Deprecation notice: A Host Class Definition may not have a name
contain a hyphen. The name 'foo-bar' is not legal at /home/vagrant/foo.pp:1:1
Notice: hai
Notice: /Stage[main]/Foo-bar/Notify[hai]/message: defined 'message' as 'hai'
Notice: Finished catalog run in 0.15 seconds
</pre>
----------------------------------------
Bug #21891: Parser not warns when incompatible chars in class name
https://projects.puppetlabs.com/issues/21891#change-95341
* Author: Zoltan Medve
* Status: Closed
* Priority: Normal
* Assignee: Charlie Sharpsteen
* Category: parser
* Target version:
* Affected Puppet version: 3.2.2
* Keywords:
* Branch:
----------------------------------------
Today I accidently tried the following:
class foo-bar {
...
}
"puppet parser validate" didn't warn me, however the class haven't run (simply
ignored it).
When I renamed the class to foo_bar, it worked like a charm. It's a bit
confusing, because node name can contain hyphen eg. web-001
--
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.
For more options, visit https://groups.google.com/groups/opt_out.