Commit caaac4f
committed
Fix serialization of undef in to_python()
:undef was used in old Puppet functions, but modern Puppet 4 functions
receive `undef` Puppet values as `nil` Ruby values. This cause
to_python() to serialize `undef` as `nil` instead of `None`, which is
not valid Python code.
Fix the to_python() behavior by comparing with `nil`. Update the test
suite accordingly.
While here, also adjust the to_ruby() function which had the same wrong
logic but was not causing trouble because in Ruby, we want to serialize
`nil` to `nil` :-)1 parent 23fdf23 commit caaac4f
File tree
4 files changed
+3
-4
lines changed- lib/puppet/functions
- spec/functions
4 files changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments