Skip to content

Commit

Permalink
Add monkey module as workaround for fabric/fabric#2090
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 5, 2022
1 parent dc0e2f8 commit b2db0f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v5.3.0
======

Added ``monkey`` module.

v5.2.1
======

Expand Down
16 changes: 16 additions & 0 deletions jaraco/fabric/monkey.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit b2db0f3

Please sign in to comment.