mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-16 04:04:31 +00:00
Address attribute-defined-outside-init.
This commit is contained in:
parent
33c8a49191
commit
0fa1dacbbd
@ -381,7 +381,6 @@ disable=raw-checker-failed,
|
|||||||
# To clean up:
|
# To clean up:
|
||||||
abstract-method,
|
abstract-method,
|
||||||
arguments-differ,
|
arguments-differ,
|
||||||
attribute-defined-outside-init,
|
|
||||||
broad-exception-caught,
|
broad-exception-caught,
|
||||||
broad-exception-raised,
|
broad-exception-raised,
|
||||||
consider-iterating-dictionary,
|
consider-iterating-dictionary,
|
||||||
|
|||||||
@ -155,6 +155,8 @@ class Connection(ConnectionBase):
|
|||||||
self._docker_args = []
|
self._docker_args = []
|
||||||
self._container_user_cache = {}
|
self._container_user_cache = {}
|
||||||
self._version = None
|
self._version = None
|
||||||
|
self.remote_user = None
|
||||||
|
self.timeout = None
|
||||||
|
|
||||||
# Windows uses Powershell modules
|
# Windows uses Powershell modules
|
||||||
if getattr(self._shell, "_IS_WINDOWS", False):
|
if getattr(self._shell, "_IS_WINDOWS", False):
|
||||||
|
|||||||
@ -66,6 +66,7 @@ class Connection(ConnectionBase):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.cwd = None
|
self.cwd = None
|
||||||
|
self._nsenter_pid = None
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
self._nsenter_pid = self.get_option("nsenter_pid")
|
self._nsenter_pid = self.get_option("nsenter_pid")
|
||||||
|
|||||||
@ -199,7 +199,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
|||||||
)
|
)
|
||||||
update_tls_hostname(raw_params)
|
update_tls_hostname(raw_params)
|
||||||
connect_params = get_connect_params(raw_params, fail_function=self._fail)
|
connect_params = get_connect_params(raw_params, fail_function=self._fail)
|
||||||
self.client = docker.DockerClient(**connect_params)
|
client = docker.DockerClient(**connect_params)
|
||||||
self.inventory.add_group("all")
|
self.inventory.add_group("all")
|
||||||
self.inventory.add_group("manager")
|
self.inventory.add_group("manager")
|
||||||
self.inventory.add_group("worker")
|
self.inventory.add_group("worker")
|
||||||
@ -217,9 +217,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
|||||||
host_uri_port = "2375"
|
host_uri_port = "2375"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.nodes = self.client.nodes.list()
|
nodes = client.nodes.list()
|
||||||
for node in self.nodes:
|
for node in nodes:
|
||||||
node_attrs = self.client.nodes.get(node.id).attrs
|
node_attrs = client.nodes.get(node.id).attrs
|
||||||
unsafe_node_attrs = make_unsafe(node_attrs)
|
unsafe_node_attrs = make_unsafe(node_attrs)
|
||||||
if not filter_host(
|
if not filter_host(
|
||||||
self, unsafe_node_attrs["ID"], unsafe_node_attrs, filters
|
self, unsafe_node_attrs["ID"], unsafe_node_attrs, filters
|
||||||
|
|||||||
@ -55,7 +55,9 @@ class NpipeSocket:
|
|||||||
def __init__(self, handle=None):
|
def __init__(self, handle=None):
|
||||||
self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT
|
self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT
|
||||||
self._handle = handle
|
self._handle = handle
|
||||||
|
self._address = None
|
||||||
self._closed = False
|
self._closed = False
|
||||||
|
self.flags = None
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|||||||
@ -134,6 +134,7 @@ class ContainerManager(DockerBaseClass):
|
|||||||
"The value of default_host_ip must be an empty string, an IPv4 address, "
|
"The value of default_host_ip must be an empty string, an IPv4 address, "
|
||||||
f'or an IPv6 address. Got "{self.param_default_host_ip}" instead.'
|
f'or an IPv6 address. Got "{self.param_default_host_ip}" instead.'
|
||||||
)
|
)
|
||||||
|
self.parameters = None
|
||||||
|
|
||||||
def _collect_all_options(self, active_options):
|
def _collect_all_options(self, active_options):
|
||||||
all_options = {}
|
all_options = {}
|
||||||
|
|||||||
@ -323,6 +323,7 @@ class TaskParameters(DockerBaseClass):
|
|||||||
self.join_token = None
|
self.join_token = None
|
||||||
self.data_path_addr = None
|
self.data_path_addr = None
|
||||||
self.data_path_port = None
|
self.data_path_port = None
|
||||||
|
self.spec = None
|
||||||
|
|
||||||
# Spec
|
# Spec
|
||||||
self.snapshot_interval = None
|
self.snapshot_interval = None
|
||||||
|
|||||||
@ -604,6 +604,7 @@ class DisableSocketTest(unittest.TestCase):
|
|||||||
class DummySocket:
|
class DummySocket:
|
||||||
def __init__(self, timeout=60):
|
def __init__(self, timeout=60):
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
self._sock = None
|
||||||
|
|
||||||
def settimeout(self, timeout):
|
def settimeout(self, timeout):
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import typing as t
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from pytest import fixture, mark
|
from pytest import fixture, mark
|
||||||
@ -26,6 +27,7 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
class FindConfigFileTest(unittest.TestCase):
|
class FindConfigFileTest(unittest.TestCase):
|
||||||
|
mkdir: t.Callable[[str], os.PathLike[str]]
|
||||||
|
|
||||||
@fixture(autouse=True)
|
@fixture(autouse=True)
|
||||||
def tmpdir(self, tmpdir):
|
def tmpdir(self, tmpdir):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user