mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +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:
|
||||
abstract-method,
|
||||
arguments-differ,
|
||||
attribute-defined-outside-init,
|
||||
broad-exception-caught,
|
||||
broad-exception-raised,
|
||||
consider-iterating-dictionary,
|
||||
|
||||
@ -155,6 +155,8 @@ class Connection(ConnectionBase):
|
||||
self._docker_args = []
|
||||
self._container_user_cache = {}
|
||||
self._version = None
|
||||
self.remote_user = None
|
||||
self.timeout = None
|
||||
|
||||
# Windows uses Powershell modules
|
||||
if getattr(self._shell, "_IS_WINDOWS", False):
|
||||
|
||||
@ -66,6 +66,7 @@ class Connection(ConnectionBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.cwd = None
|
||||
self._nsenter_pid = None
|
||||
|
||||
def _connect(self):
|
||||
self._nsenter_pid = self.get_option("nsenter_pid")
|
||||
|
||||
@ -199,7 +199,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||
)
|
||||
update_tls_hostname(raw_params)
|
||||
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("manager")
|
||||
self.inventory.add_group("worker")
|
||||
@ -217,9 +217,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||
host_uri_port = "2375"
|
||||
|
||||
try:
|
||||
self.nodes = self.client.nodes.list()
|
||||
for node in self.nodes:
|
||||
node_attrs = self.client.nodes.get(node.id).attrs
|
||||
nodes = client.nodes.list()
|
||||
for node in nodes:
|
||||
node_attrs = client.nodes.get(node.id).attrs
|
||||
unsafe_node_attrs = make_unsafe(node_attrs)
|
||||
if not filter_host(
|
||||
self, unsafe_node_attrs["ID"], unsafe_node_attrs, filters
|
||||
|
||||
@ -55,7 +55,9 @@ class NpipeSocket:
|
||||
def __init__(self, handle=None):
|
||||
self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT
|
||||
self._handle = handle
|
||||
self._address = None
|
||||
self._closed = False
|
||||
self.flags = None
|
||||
|
||||
def accept(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
@ -134,6 +134,7 @@ class ContainerManager(DockerBaseClass):
|
||||
"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.'
|
||||
)
|
||||
self.parameters = None
|
||||
|
||||
def _collect_all_options(self, active_options):
|
||||
all_options = {}
|
||||
|
||||
@ -323,6 +323,7 @@ class TaskParameters(DockerBaseClass):
|
||||
self.join_token = None
|
||||
self.data_path_addr = None
|
||||
self.data_path_port = None
|
||||
self.spec = None
|
||||
|
||||
# Spec
|
||||
self.snapshot_interval = None
|
||||
|
||||
@ -604,6 +604,7 @@ class DisableSocketTest(unittest.TestCase):
|
||||
class DummySocket:
|
||||
def __init__(self, timeout=60):
|
||||
self.timeout = timeout
|
||||
self._sock = None
|
||||
|
||||
def settimeout(self, timeout):
|
||||
self.timeout = timeout
|
||||
|
||||
@ -12,6 +12,7 @@ import json
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import typing as t
|
||||
import unittest
|
||||
|
||||
from pytest import fixture, mark
|
||||
@ -26,6 +27,7 @@ except ImportError:
|
||||
|
||||
|
||||
class FindConfigFileTest(unittest.TestCase):
|
||||
mkdir: t.Callable[[str], os.PathLike[str]]
|
||||
|
||||
@fixture(autouse=True)
|
||||
def tmpdir(self, tmpdir):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user