mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
updates ensure_connect decorator function
only calls _connect() if _connected is False
This commit is contained in:
parent
8296511ed0
commit
83fe2170ff
1 changed files with 2 additions and 1 deletions
|
@ -49,7 +49,8 @@ BUFSIZE = 65536
|
|||
def ensure_connect(func):
|
||||
@wraps(func)
|
||||
def wrapped(self, *args, **kwargs):
|
||||
self._connect()
|
||||
if not self._connected:
|
||||
self._connect()
|
||||
return func(self, *args, **kwargs)
|
||||
return wrapped
|
||||
|
||||
|
|
Loading…
Reference in a new issue