From b01869a0159e906cf4eb89e0f883447d29dbb823 Mon Sep 17 00:00:00 2001 From: Bogdan Muresan Date: Mon, 13 May 2024 12:13:44 +0300 Subject: [PATCH] Fix adhoc role permission name in object diff. (#826) * Fix adhoc role permission name in object diff. * Update controller_object_diff.py --------- Co-authored-by: Leon Muresan,Bogdan,CH-Lausanne Co-authored-by: Tom Page --- changelogs/fragments/adhoc_role_name_object_diff.yml | 4 ++++ plugins/lookup/controller_object_diff.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/adhoc_role_name_object_diff.yml diff --git a/changelogs/fragments/adhoc_role_name_object_diff.yml b/changelogs/fragments/adhoc_role_name_object_diff.yml new file mode 100644 index 000000000..7df31e9ed --- /dev/null +++ b/changelogs/fragments/adhoc_role_name_object_diff.yml @@ -0,0 +1,4 @@ +--- +bugfixes: + - Fix "adhoc" role permission name in object diff. +... diff --git a/plugins/lookup/controller_object_diff.py b/plugins/lookup/controller_object_diff.py index 7babf5e0b..5b168bd3c 100644 --- a/plugins/lookup/controller_object_diff.py +++ b/plugins/lookup/controller_object_diff.py @@ -230,7 +230,7 @@ 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(" ", "_")}) + item.update({"role": item["name"].lower().replace(" ", "_").replace("ad_hoc", "adhoc")}) # Remove the extra fields item.pop("users") item.pop("teams")