Bug #4269
behavior change in 2.6: undef variables are not anymore empty strings
| Status: | Closed | Start date: | 07/17/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | 2.6.0 | |||
| Affected Puppet version: | 2.6.0rc3 | Branch: | http://github.com/nicklewis/puppet/tree/ticket/master/4269-undef_interpolation | |
| Keywords: | ||||
| Votes: | 1 |
Description
The following manifest:
$ cat foo.pp
notice $a
exec{"/bin/echo a=$a > /tmp/foo": }
produced in 0.25.x the following:
$ puppet foo.pp notice: Scope(Class[main]): notice: //Exec[/bin/echo a= > /tmp/foo]/returns: executed successfully $ cat /tmp/foo a=
However 2.6 produces:
$ puppet foo.pp notice: Scope(Class[main]): undef notice: /Stage[main]//Exec[/bin/echo a=undef > /tmp/foo]/returns: executed successfully $ cat /tmp/foo a=undef
This changes the behavior of various execs and generate functions. In regard to ruby’s behavior of nil.to_s undef variables should also be empty strings.
Otherwise this should be documented, but it will give some headaches in mixed enviornments.
History
Updated by Peter Meier almost 2 years ago
probably related to #4236, but I’m not sure if the fix there fixes that problem
Updated by Brice Figureau almost 2 years ago
Peter Meier wrote:
probably related to #4236, but I’m not sure if the fix there fixes that problem
Related because it is the same issue, but the fix there doesn’t take this into account.
We need to change the variable interpolation to return ‘’ instead of :undef…
Updated by James Turnbull almost 2 years ago
- Status changed from Unreviewed to Investigating
- Assignee set to Markus Roberts
- Target version set to 2.6.0
Updated by Markus Roberts almost 2 years ago
- Status changed from Investigating to Accepted
- Assignee changed from Markus Roberts to Nick Lewis
Updated by Nick Lewis almost 2 years ago
- Status changed from Accepted to In Topic Branch Pending Review
- Branch set to http://github.com/nicklewis/puppet/tree/ticket/master/4269-undef_interpolation
Updated by Peter Meier almost 2 years ago
looks good.
Updated by James Turnbull almost 2 years ago
- Status changed from In Topic Branch Pending Review to Closed
Pushed in commit:06fc40c5d755a41c8ece84a3d437572a64b4c899 in branch master.