Make Utility Modules accessible from the py pillar renderer #68555
Replies: 2 comments 1 reply
-
|
because utils is horrible. it has caused the biggest performance problems of any of the subsystems. as well as caused the most broken loops of all time. it is not recommended to use utils within modules Let alone renderers. this is why it also isn't supported by saltstack extensions. it isn't used in any of the render engines. it isn't a oversight. the proper thing to do is just include the salt utility modules directly. I know @s0undt3ch was in the process of rewritting things to the point that it could be decommend and has ALWAYS said don't use it. but because it was wrapped in so many things it wasn't going to be finished before the big decomm of modules. and then broadcom happened. and that project was left half finished. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a bunch of pillar files using the pure Python renderer (
#!py). Some had large sections of code that were similar, so I broke them out into Utility Modules.After hours of trial and error, I determined that the only options to make this work was to either:
I've tried all three options, and I think I like option 3 the best. I eventually came up with this:
salt/_renderers/pyutils.py
It appears to do the job, but ideally the built-in "py" renderer would support accessing
__utils__out-of-the-box.I'm wondering if there is any reason why utility module access isn't included by default, or if its omission was just an oversight?
Beta Was this translation helpful? Give feedback.
All reactions