From 68148eb5ad4e9da7f91e117c8f7028f70e8da22f Mon Sep 17 00:00:00 2001 From: ivarmu <26822043+ivarmu@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:24:46 +0200 Subject: [PATCH] fix lintering issues --- plugins/lookup/controller_object_diff.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/lookup/controller_object_diff.py b/plugins/lookup/controller_object_diff.py index 4d740b897..b9926cea1 100644 --- a/plugins/lookup/controller_object_diff.py +++ b/plugins/lookup/controller_object_diff.py @@ -186,7 +186,12 @@ def run(self, terms, variables=None, **kwargs): api_list_reduced = copy.deepcopy(api_list) elif api_list[0]["type"] == "instance_group": compare_list_reduced = [{key: item[key] for key in keys_to_keep} for item in compare_list] - api_list_reduced = [{key: item[key] for key in api_keys_to_keep} for item in api_list if (item["summary_fields"] and item["summary_fields"]["user_capabilities"]["delete"])] + api_list_reduced = [ + {key: item[key] for key in api_keys_to_keep} + for item in api_list + if (item["summary_fields"] and item["summary_fields"]["user_capabilities"]["delete"]) + ] + else: compare_list_reduced = [{key: item[key] for key in keys_to_keep} for item in compare_list] api_list_reduced = [{key: item[key] for key in api_keys_to_keep} for item in api_list] @@ -203,7 +208,7 @@ def run(self, terms, variables=None, **kwargs): item.pop("summary_fields") elif api_list[0]["type"] == "credential": for item in api_list_reduced: - item.update({"organization": item["summary_fields"]["organization"]["name"] if item["summary_fields"]["organization"] else ''}) + item.update({"organization": item["summary_fields"]["organization"]["name"] if item["summary_fields"]["organization"] else ""}) item.update({"credential_type": item["summary_fields"]["credential_type"]["name"]}) item.pop("summary_fields") elif api_list[0]["type"] == "workflow_job_template_node":