mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 10:40:22 -07:00
Not a full port to v2's api, just a few fixups
This commit is contained in:
parent
6a8062baad
commit
bf003d31e0
1 changed files with 9 additions and 3 deletions
|
@ -26,8 +26,9 @@ import struct
|
||||||
import time
|
import time
|
||||||
from ansible.callbacks import vvv, vvvv
|
from ansible.callbacks import vvv, vvvv
|
||||||
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
||||||
from ansible.runner.connection_plugins.ssh import Connection as SSHConnection
|
from . import ConnectionBase
|
||||||
from ansible.runner.connection_plugins.paramiko_ssh import Connection as ParamikoConnection
|
from .ssh import Connection as SSHConnection
|
||||||
|
from .paramiko_ssh import Connection as ParamikoConnection
|
||||||
from ansible import utils
|
from ansible import utils
|
||||||
from ansible import constants
|
from ansible import constants
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ from ansible import constants
|
||||||
# multiple of the value to speed up file reads.
|
# multiple of the value to speed up file reads.
|
||||||
CHUNK_SIZE=1044*20
|
CHUNK_SIZE=1044*20
|
||||||
|
|
||||||
class Connection(object):
|
class Connection(ConnectionBase):
|
||||||
''' raw socket accelerated connection '''
|
''' raw socket accelerated connection '''
|
||||||
|
|
||||||
def __init__(self, runner, host, port, user, password, private_key_file, *args, **kwargs):
|
def __init__(self, runner, host, port, user, password, private_key_file, *args, **kwargs):
|
||||||
|
@ -91,6 +92,11 @@ class Connection(object):
|
||||||
if getattr(self.runner, 'aes_keys', None):
|
if getattr(self.runner, 'aes_keys', None):
|
||||||
utils.AES_KEYS = self.runner.aes_keys
|
utils.AES_KEYS = self.runner.aes_keys
|
||||||
|
|
||||||
|
@property
|
||||||
|
def transport(self):
|
||||||
|
"""String used to identify this Connection class from other classes"""
|
||||||
|
return 'accelerate'
|
||||||
|
|
||||||
def _execute_accelerate_module(self):
|
def _execute_accelerate_module(self):
|
||||||
args = "password=%s port=%s minutes=%d debug=%d ipv6=%s" % (
|
args = "password=%s port=%s minutes=%d debug=%d ipv6=%s" % (
|
||||||
base64.b64encode(self.key.__str__()),
|
base64.b64encode(self.key.__str__()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue