Commit ddd8c4c
committed
Merge resource state results into managing minion and add tests
For state functions (state.apply, state.highstate, state.sls, etc.) run
against a wildcard glob, resource jobs are now executed inline by the
managing minion and their results folded into a single response block,
producing one Summary section instead of one per resource.
Key changes:
- salt/utils/minions.py: add _MERGE_RESOURCE_FUNS; check_minions accepts
fun= and skips resource augmentation for merge-mode functions so the
master does not wait for separate per-resource responses
- salt/master.py: pass fun= to check_minions at publish time
- salt/minion.py: add _MERGE_RESOURCE_FUNS and _prefix_resource_state_key
(refactored to @staticmethod); _handle_payload skips separate resource
dispatch for merge-mode functions; _thread_return executes resources
inline and merges prefixed state keys into the managing minion's ret,
reporting Result: False for unsupported functions and missing loaders
- salt/modules/sshresource_state.py: highstate() returns a no_|-states
state dict (Result: False) when the top file has no match; _exec_state_pkg
recovers valid state dicts from SSHCommandExecutionError instead of
re-raising and losing the result
Tests:
- test_minions_resources.py: merge-fun skips augmentation, non-merge and
no-fun still augment, compound targets unaffected
- test_minion_resources.py: _MERGE_RESOURCE_FUNS membership and sync
invariant, _prefix_resource_state_key correctness and fallback, merge
block no-loader/unsupported/dict/string branches
- test_sshresource_state.py (new): empty-chunks no-top-file return,
SSHCommandExecutionError recovery and re-raise cases, normal envelope path1 parent bd79674 commit ddd8c4c
7 files changed
Lines changed: 1223 additions & 186 deletions
File tree
- salt
- modules
- utils
- tests/pytests/unit
- modules
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1654 | 1654 | | |
1655 | 1655 | | |
1656 | 1656 | | |
1657 | | - | |
1658 | | - | |
| 1657 | + | |
| 1658 | + | |
1659 | 1659 | | |
1660 | 1660 | | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
1664 | 1665 | | |
1665 | 1666 | | |
1666 | 1667 | | |
1667 | 1668 | | |
1668 | 1669 | | |
1669 | | - | |
1670 | | - | |
| 1670 | + | |
| 1671 | + | |
1671 | 1672 | | |
1672 | 1673 | | |
1673 | 1674 | | |
| |||
2366 | 2367 | | |
2367 | 2368 | | |
2368 | 2369 | | |
2369 | | - | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
2370 | 2374 | | |
2371 | 2375 | | |
2372 | 2376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2868 | 2868 | | |
2869 | 2869 | | |
2870 | 2870 | | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
2871 | 2994 | | |
2872 | 2995 | | |
2873 | 2996 | | |
| |||
4379 | 4502 | | |
4380 | 4503 | | |
4381 | 4504 | | |
4382 | | - | |
4383 | | - | |
4384 | | - | |
4385 | | - | |
4386 | | - | |
4387 | | - | |
4388 | | - | |
4389 | | - | |
| 4505 | + | |
| 4506 | + | |
| 4507 | + | |
| 4508 | + | |
| 4509 | + | |
| 4510 | + | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
| 4517 | + | |
| 4518 | + | |
4390 | 4519 | | |
4391 | 4520 | | |
4392 | 4521 | | |
| |||
4473 | 4602 | | |
4474 | 4603 | | |
4475 | 4604 | | |
| 4605 | + | |
| 4606 | + | |
| 4607 | + | |
| 4608 | + | |
| 4609 | + | |
| 4610 | + | |
| 4611 | + | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
| 4617 | + | |
| 4618 | + | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
4476 | 4635 | | |
4477 | 4636 | | |
4478 | 4637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
284 | 302 | | |
285 | 303 | | |
286 | 304 | | |
| |||
436 | 454 | | |
437 | 455 | | |
438 | 456 | | |
439 | | - | |
440 | | - | |
441 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
442 | 473 | | |
443 | 474 | | |
444 | | - | |
445 | 475 | | |
446 | 476 | | |
447 | | - | |
448 | | - | |
| 477 | + | |
| 478 | + | |
449 | 479 | | |
450 | 480 | | |
451 | 481 | | |
0 commit comments