From 24ecf8e5840a147d252b3cad0272171818c19e2d Mon Sep 17 00:00:00 2001 From: Michael Sekania Date: Mon, 19 Feb 2024 14:50:08 +0100 Subject: [PATCH] fix: style --- plugins/modules/cluster.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/modules/cluster.py b/plugins/modules/cluster.py index 7c7fb4d2d..7783b5c0a 100644 --- a/plugins/modules/cluster.py +++ b/plugins/modules/cluster.py @@ -213,7 +213,9 @@ class ClusterHostHTTPCodes: 200: (True, False, "Cluster host edited"), 412: (True, False, "eTag changed, because cluster host nodes were modified"), } - modify = {200: (True, False, "Cluster host nodes modified"),} + modify = { + 200: (True, False, "Cluster host nodes modified"), + } delete = {204: (True, False, "Cluster host deleted")} @@ -351,7 +353,10 @@ def _detect_changes(self): desired_nodes = desired_attributes.get("nodes") - if len([el for el in current_nodes if el not in desired_nodes]) > 0 or len([el for el in desired_nodes if el not in current_nodes]) > 0: + if ( + len([el for el in current_nodes if el not in desired_nodes]) > 0 + or len([el for el in desired_nodes if el not in current_nodes]) > 0 + ): changes.append("nodes") else: desired_attributes.pop("nodes") @@ -512,14 +517,9 @@ def edit(self): ) result_nodes = result_nodes._replace( - msg=result_nodes.msg - + ". Nodes modified to: %s" % tmp.get("nodes") + msg=result_nodes.msg + ". Nodes modified to: %s" % tmp.get("nodes") ) - if not data.get("update_attributes"): - data["update_attributes"] = data.pop("attributes") - - result = self._fetch( code_mapping=ClusterHostHTTPCodes.edit, endpoint=self._build_default_endpoint(),