From 4a9ec3e3078dfd7cadce73f7809a19c4cfd213c7 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 25 Oct 2025 01:22:46 +0200 Subject: [PATCH] Remove no longer needed pylint ignores. --- .pylintrc | 2 -- plugins/modules/docker_node.py | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index 8f3dceb3..fe23bb35 100644 --- a/.pylintrc +++ b/.pylintrc @@ -385,12 +385,10 @@ disable=raw-checker-failed, import-error, # TODO figure out why pylint cannot find the module no-member, no-name-in-module, # TODO figure out why pylint cannot find the module - not-an-iterable, # TODO: needs better typing info protected-access, redefined-outer-name, # needed for test fixtures subprocess-popen-preexec-fn, unexpected-keyword-arg, - unsupported-assignment-operation, # TODO: needs better typing info unused-argument, # Cannot remove yet due to inadequacy of rules inconsistent-return-statements, # doesn't notice that fail_json() does not return diff --git a/plugins/modules/docker_node.py b/plugins/modules/docker_node.py index 55e5f6af..a2b25fb3 100644 --- a/plugins/modules/docker_node.py +++ b/plugins/modules/docker_node.py @@ -237,11 +237,12 @@ class SwarmNodeManager(DockerBaseClass): node_spec["Labels"] = self.parameters.labels changed = True elif self.parameters.labels_state == "merge": - node_spec["Labels"] = dict(node_info["Spec"]["Labels"] or {}) + labels: dict[str, str] = dict(node_info["Spec"]["Labels"] or {}) + node_spec["Labels"] = labels if self.parameters.labels is not None: for key, value in self.parameters.labels.items(): - if node_spec["Labels"].get(key) != value: - node_spec["Labels"][key] = value + if labels.get(key) != value: + labels[key] = value changed = True if self.parameters.labels_to_remove is not None: