From 6a3c083c0f010d1286ef5da3fc504a935e7e0d57 Mon Sep 17 00:00:00 2001 From: "Leon Muresan,Bogdan,CH-Lausanne" Date: Wed, 24 Jul 2024 13:54:24 +0300 Subject: [PATCH] Fix approval role permission name in object diff. --- changelogs/fragments/aapproval_role_name_object_diff.yml | 4 ++++ plugins/lookup/controller_object_diff.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/aapproval_role_name_object_diff.yml diff --git a/changelogs/fragments/aapproval_role_name_object_diff.yml b/changelogs/fragments/aapproval_role_name_object_diff.yml new file mode 100644 index 000000000..194e0f6e5 --- /dev/null +++ b/changelogs/fragments/aapproval_role_name_object_diff.yml @@ -0,0 +1,4 @@ +--- +bugfixes: + - Fix "approval" role permission name in object diff. +... diff --git a/plugins/lookup/controller_object_diff.py b/plugins/lookup/controller_object_diff.py index ebd776ae6..e33a4013c 100644 --- a/plugins/lookup/controller_object_diff.py +++ b/plugins/lookup/controller_object_diff.py @@ -231,7 +231,11 @@ def run(self, terms, variables=None, **kwargs): item.update({"organizations": [item[item["resource_type"]]]}) if item["resource_type"] == "instance_group": item.update({"instance_groups": [item[item["resource_type"]]]}) - item.update({"role": item["name"].lower().replace(" ", "_").replace("ad_hoc", "adhoc")}) + item.update({"role": item["name"].lower() + .replace(" ", "_") + .replace("ad_hoc", "adhoc") + .replace("approve", "approval") + }) # Remove the extra fields item.pop("users") item.pop("teams")