mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Move BUFSIZE to __init__ since it's common to many connection plugins
This commit is contained in:
parent
b77c4ce458
commit
fee73100c4
6 changed files with 7 additions and 15 deletions
|
@ -42,6 +42,8 @@ except ImportError:
|
||||||
|
|
||||||
__all__ = ['ConnectionBase', 'ensure_connect']
|
__all__ = ['ConnectionBase', 'ensure_connect']
|
||||||
|
|
||||||
|
BUFSIZE = 65536
|
||||||
|
|
||||||
|
|
||||||
def ensure_connect(func):
|
def ensure_connect(func):
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
|
|
|
@ -28,7 +28,7 @@ import traceback
|
||||||
|
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.plugins.connection import ConnectionBase
|
from ansible.plugins.connection import ConnectionBase, BUFSIZE
|
||||||
from ansible.module_utils.basic import is_executable
|
from ansible.module_utils.basic import is_executable
|
||||||
from ansible.utils.unicode import to_bytes
|
from ansible.utils.unicode import to_bytes
|
||||||
|
|
||||||
|
@ -38,8 +38,6 @@ except ImportError:
|
||||||
from ansible.utils.display import Display
|
from ansible.utils.display import Display
|
||||||
display = Display()
|
display = Display()
|
||||||
|
|
||||||
BUFSIZE = 65536
|
|
||||||
|
|
||||||
|
|
||||||
class Connection(ConnectionBase):
|
class Connection(ConnectionBase):
|
||||||
''' Local chroot based connections '''
|
''' Local chroot based connections '''
|
||||||
|
|
|
@ -35,7 +35,7 @@ from distutils.version import LooseVersion
|
||||||
|
|
||||||
import ansible.constants as C
|
import ansible.constants as C
|
||||||
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
||||||
from ansible.plugins.connection import ConnectionBase
|
from ansible.plugins.connection import ConnectionBase, BUFSIZE
|
||||||
from ansible.utils.unicode import to_bytes
|
from ansible.utils.unicode import to_bytes
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -44,8 +44,6 @@ except ImportError:
|
||||||
from ansible.utils.display import Display
|
from ansible.utils.display import Display
|
||||||
display = Display()
|
display = Display()
|
||||||
|
|
||||||
BUFSIZE = 65536
|
|
||||||
|
|
||||||
|
|
||||||
class Connection(ConnectionBase):
|
class Connection(ConnectionBase):
|
||||||
''' Local docker based connections '''
|
''' Local docker based connections '''
|
||||||
|
|
|
@ -29,7 +29,7 @@ import traceback
|
||||||
|
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.plugins.connection import ConnectionBase
|
from ansible.plugins.connection import ConnectionBase, BUFSIZE
|
||||||
from ansible.utils.unicode import to_bytes
|
from ansible.utils.unicode import to_bytes
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -38,8 +38,6 @@ except ImportError:
|
||||||
from ansible.utils.display import Display
|
from ansible.utils.display import Display
|
||||||
display = Display()
|
display = Display()
|
||||||
|
|
||||||
BUFSIZE = 65536
|
|
||||||
|
|
||||||
|
|
||||||
class Connection(ConnectionBase):
|
class Connection(ConnectionBase):
|
||||||
''' Local BSD Jail based connections '''
|
''' Local BSD Jail based connections '''
|
||||||
|
|
|
@ -29,7 +29,7 @@ import traceback
|
||||||
|
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.plugins.connection import ConnectionBase
|
from ansible.plugins.connection import ConnectionBase, BUFSIZE
|
||||||
from ansible.utils.unicode import to_bytes
|
from ansible.utils.unicode import to_bytes
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -38,8 +38,6 @@ except ImportError:
|
||||||
from ansible.utils.display import Display
|
from ansible.utils.display import Display
|
||||||
display = Display()
|
display = Display()
|
||||||
|
|
||||||
BUFSIZE = 65536
|
|
||||||
|
|
||||||
|
|
||||||
class Connection(ConnectionBase):
|
class Connection(ConnectionBase):
|
||||||
''' Local lxc based connections '''
|
''' Local lxc based connections '''
|
||||||
|
|
|
@ -30,7 +30,7 @@ import traceback
|
||||||
|
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.plugins.connection import ConnectionBase
|
from ansible.plugins.connection import ConnectionBase, BUFSIZE
|
||||||
from ansible.utils import to_bytes
|
from ansible.utils import to_bytes
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -39,8 +39,6 @@ except ImportError:
|
||||||
from ansible.utils.display import Display
|
from ansible.utils.display import Display
|
||||||
display = Display()
|
display = Display()
|
||||||
|
|
||||||
BUFSIZE = 65536
|
|
||||||
|
|
||||||
|
|
||||||
class Connection(ConnectionBase):
|
class Connection(ConnectionBase):
|
||||||
''' Local zone based connections '''
|
''' Local zone based connections '''
|
||||||
|
|
Loading…
Reference in a new issue