saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
13.98k stars 5.47k forks source link

[3006.x] Allow NamedLoaderContexts to be returned from loaded functions #66649

Closed dwoz closed 1 week ago

dwoz commented 1 week ago

It is useful in some cases to return NamedLoaderContexts from loaded functions. Instead of choking or requiring implementers to call the context's value() method before being de-scoped, detect when a NamedLoaderContext has been returned and return the value from the current context.

What issues does this PR fix or reference?

Fixes: #65251

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.