Issue #12577 has been updated by Roland Kaminski.
Hi,
recently we were trying to assemble a file made of different parts. We stumbled
upon, in my opinion, strange behavior of the append operator. The example below
produces two different files with different content. From what I gather from
the language guide both files should contain the string “foo” but the second
file does not. We are using the debian-squeeze version of the puppet client and
master (I do not have a newer version at hand to test whether this has already
been addressed.
Note that exchanging the define with a class and then including class bar would
result in two files with the string “foobar”. The language guide is unclear
about such cases too.
Regards, Roland
class foo {
$foo = "foo"
define bar () {
$foo::foo += "bar"
}
bar { "bar": }
file {
"/root/foo":
content => "$foo";
"/root/foobar":
content => $foo;
}
}
----------------------------------------
Bug #12577: Append operator in defines
https://projects.puppetlabs.com/issues/12577#change-54453
Author: Roland Kaminski
Status: Unreviewed
Priority: Normal
Assignee:
Category: language
Target version:
Affected Puppet version: 2.6.2
Keywords: append scope define
Branch:
Hi,
recently we were trying to assemble a file made of different parts. We stumbled
upon, in my opinion, strange behavior of the append operator. The example below
produces two different files with different content. From what I gather from
the language guide both files should contain the string "foo" but the second
file does not. We are using the debian-squeeze version of the puppet client and
master (I do not have a newer version at hand to test whether this has already
been addressed.
Note that exchanging the define with a class and then including class bar would
result in two files with the string "foobar". The language guide is unclear
about such cases too.
Regards, Roland
class foo {
$foo = "foo"
define bar () {
$foo::foo += "bar"
}
bar { "bar": }
file {
"/root/foo":
content => "$foo";
"/root/foobar":
content => $foo;
}
}
--
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.