Commit e07e131
committed
Fix __pillar__ access in modules in pillar render
Historically the __pillar__ dunder has never been available or worked
in extension modules during pillar render, due to what I can only assume
is a bug/oversight in the overly-complex mess of branches and logic in
the pillar rendering code. Functionally there is very little reason this
shouldn't work, and it even appears like it may have worked at some
point, or at least was intended to work by the fact that the ext_pillar
data was stuffed right back into opts before attempting to render the
remainder of the pillar.
The missing piece to the puzzle here was that the partially-rendered
ext_pillar data wasn't available in the opts dict packed into the
salt.loader.minion_mods() call when it was generated, and the fact that
the functions weren't reloaded after the pillar dict was updated. This
commit fixes both of those things.
Ensure the minion_mods are *always* reloaded with the updated opts dict
containing the partial pillar data when rendering pillar with
ext_pillar_first enabled.
Signed-off-by: Joe Groocock <jgroocock@cloudflare.com>1 parent c92ff12 commit e07e131
File tree
3 files changed
+54
-10
lines changed- changelog
- salt/pillar
- tests/pytests/unit/pillar
3 files changed
+54
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| 540 | + | |
540 | 541 | | |
541 | 542 | | |
542 | 543 | | |
| |||
547 | 548 | | |
548 | 549 | | |
549 | 550 | | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
| 551 | + | |
| 552 | + | |
560 | 553 | | |
561 | 554 | | |
562 | 555 | | |
| |||
620 | 613 | | |
621 | 614 | | |
622 | 615 | | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
623 | 639 | | |
624 | 640 | | |
625 | 641 | | |
| |||
1217 | 1233 | | |
1218 | 1234 | | |
1219 | 1235 | | |
| 1236 | + | |
| 1237 | + | |
1220 | 1238 | | |
1221 | 1239 | | |
1222 | 1240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
0 commit comments