Hi,
Thanks for the pointer. So if I understand it correctly, the code creates a new module and copies all functions from the old one to the new one, except for the function you want to change.
I've thought the self-patching solution, but replacing a function in the execution module gives me a bit more control on the life cycle of the patch. It keeps the patch and the original code completely separate. This also reduces the risk that the patch gets overwritten when, for example, salt is upgraded. I hope to only have this patch installed for a single release of our product.
Best regards,
Emond