Issue #4408 has been updated by Robert Rothenberg.
I've found what seems to be a related issue. The order of setting parameters
values seems to be non-determistic, so the following is dangerous:
class foo(
$owner,
$prefix = "/opt/${owner}",
$etc_dir = "${prefix}/etc"
) {
file{"${etc_dir}":
ensure => directory,
owner => $owner,
group => $owner,
mode => 0660,
}
Sometimes when it's run, $etc_dir is instantiated before $prefix, which means
it's equal to "/etc". Naturally restricting the ownership and permissions to
etc will kill a server.
Fortunately, I found this issue while testing Puppet on disposable virtual
machines rather than a live server.
Until this issue is fixed, warnings about the non-deterministic behaviour of
parameters should be documented.
A related feature request might be to order the setting of parameters by their
dependencies on one another.
----------------------------------------
Feature #4408: A 'strict' variable mode should be added
https://projects.puppetlabs.com/issues/4408#change-60612
Author: Stig Sandbeck Mathisen
Status: Accepted
Priority: Normal
Assignee:
Category: language
Target version:
Affected Puppet version: 0.25.1
Keywords:
Branch:
This is an issue reported in the Debian Bug Tracker at
[[http://bugs.debian.org/563550]].
Excerpt:
<blockquote>
The puppet manifest language uses empty variables the same way then
undefined ones. Many languages, for example perl and sql, have shown in
the past that this behaviour produces hard to find errors all over the
code.
Example:
lsb* are undefined if lsb-release is missing. A definition using this
needs to explicitely check for the lack of a value. It would be obvious
if it bails out on the variable access.
This is also different from the behaviour of the templating language,
erb bails out on undefined variables.
</blockquote>
--
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.