Details
Description
As decided in PUP-1397, hyphenated class names will no longer be allowed by the Puppet 4.x parser.
# tst.pp
|
|
class my-class {
|
$test = "content"
|
notify {$test:}
|
}
|
|
include 'my-class'
|
Currently, the standard parser accepts these names without complaint:
# puppet apply tst.pp
|
|
Notice: Compiled catalog for os-head-centos.puppetdebug.vlan in environment production in 0.06 seconds
|
Notice: content
|
Notice: /Stage[main]/My-class/Notify[content]/message: defined 'message' as 'content'
|
Notice: Finished catalog run in 0.11 seconds
|
In 3.4.x, the future parser emits a depreciation warning:
# puppet apply tst.pp --parser=future
|
|
Warning: Deprecation notice: A Host Class Definition may not have a name containing a hyphen. The name 'my-class' is not legal at /vagrant/PUP-1397/tst.pp:1:1
|
Notice: Compiled catalog for os-head-centos.puppetdebug.vlan in environment production in 0.85 seconds
|
Notice: content
|
Notice: /Stage[main]/My-class/Notify[content]/message: defined 'message' as 'content'
|
Notice: Finished catalog run in 0.23 seconds
|
In Puppet 3.5.0 and newer, the future parser emits a hard error:
# puppet apply tst.pp --parser=future
|
Error: Could not parse for environment production: Syntax error at 'my-class' at /vagrant/PUP-1397/tst.pp:1:7 on node os-head-centos.puppetdebug.vlan
|
Error: Could not parse for environment production: Syntax error at 'my-class' at /vagrant/PUP-1397/tst.pp:1:7 on node os-head-centos.puppetdebug.vlan
|
A depreciation warning needs to be added to the standard parser before the jump to 4.x.
Attachments
Issue Links
- relates to
-
PUP-1397 hyphen in class name messes with qualified variables
-
- Closed
-