Skip to content

Commit

Permalink
Only apply workaround when 'key_filename' is defined. Closes #5.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 6, 2023
1 parent 48b8e3c commit 16cb1ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jaraco/fabric/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ def workaround_2090(func):

@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)
]
if 'key_filename' in c.connect_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)

return wrapper
1 change: 1 addition & 0 deletions newsfragments/5.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed issue with workaround for fabric/fabric#2090.

0 comments on commit 16cb1ab

Please sign in to comment.