saltext.vault.utils.functools

Fixed namespaced_function from salt.utils.functools

saltext.vault.utils.functools.namespaced_function(function, global_dict)[source]

Patched function taken from salt.utils.functools. It does not set kwdefaults.

Redefine (clone) a function under a different globals() namespace scope.

Any keys missing in the passed global_dict that is present in the passed function __globals__ attribute get’s copied over into global_dict, thus avoiding NameError from modules imported in the original function module.