mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-15 17:40:50 -07:00
Decorate the ConnectionBase methods, switch to calling super from individual connection classes
This commit is contained in:
parent
9754c67138
commit
bce281014c
5 changed files with 32 additions and 12 deletions
|
@ -92,16 +92,19 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
|
|||
"""Connect to the host we've been initialized with"""
|
||||
pass
|
||||
|
||||
@ensure_connect
|
||||
@abstractmethod
|
||||
def exec_command(self, cmd, tmp_path, executable=None, in_data=None):
|
||||
"""Run a command on the remote host"""
|
||||
pass
|
||||
|
||||
@ensure_connect
|
||||
@abstractmethod
|
||||
def put_file(self, in_path, out_path):
|
||||
"""Transfer a file from local to remote"""
|
||||
pass
|
||||
|
||||
@ensure_connect
|
||||
@abstractmethod
|
||||
def fetch_file(self, in_path, out_path):
|
||||
"""Fetch a file from remote to local"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue