Commit ddab620
committed
Preserve
Until now, a reference with a default value which is a reference that
resolves to a YAML `null` value would result in a YAML string `"None"`
when the resolution falls back on the default value.
The cause for this is that we serialized `Value::Null` to `"None"` until
now to preserve compatibility with Python's `str()` for nested reference
lookups (since Python Reclass just uses `str()` to serialize nested
references).
This commit changes the serialization of `Value::Null` to `"null"` which
is preserved as a YAML `null` when a reference default value is defined
as a nested reference that resolves to YAML `null`.
Conversely, any existing nested references that expect YAML `null` to be
serialized as `None` will break with this change.null for reference default value defined as reference1 parent d2cc865 commit ddab620
4 files changed
Lines changed: 25 additions & 3 deletions
File tree
- src/types
- value
- tests
- inventory-reference-default-values/nodes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | | - | |
488 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
0 commit comments