diff --git a/CHANGES.rst b/CHANGES.rst index c26100c..9eb14dc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,8 @@ +v5.3.0 +====== + +Added ``monkey`` module. + v5.2.1 ====== diff --git a/jaraco/fabric/monkey.py b/jaraco/fabric/monkey.py new file mode 100644 index 0000000..65a3d24 --- /dev/null +++ b/jaraco/fabric/monkey.py @@ -0,0 +1,16 @@ +import functools + + +def workaround_2090(func): + """ + Wrap a task func to work around fabric/fabric#2090. + """ + + @functools.wraps(func) + def wrapper(c, *args, **kwargs): + c.connect_kwargs['key_filename'][:] = [ + key + for key in c.connect_kwargs['key_filename'] + if __import__('os').path.exists(key) + ] + return func(c, *args, **kwargs)