From 2f75ead8a547932c25acb0453ac8909b19f73c52 Mon Sep 17 00:00:00 2001 From: Jeenitkumar Khatri <58591067+JkhatriInfobox@users.noreply.github.com> Date: Fri, 12 Jul 2024 17:49:36 +0530 Subject: [PATCH] [FIX] NPA-73, Re-execution showing change for each execution. (#240) --- plugins/module_utils/api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py index 4ba56feb..d4d99f75 100644 --- a/plugins/module_utils/api.py +++ b/plugins/module_utils/api.py @@ -219,6 +219,8 @@ def convert_ea_list_to_struct(member_spec): ''' Transforms the list of the values into a valid WAPI struct. ''' if 'list_values' in member_spec.keys(): + if all(isinstance(item, dict) for item in member_spec['list_values']): + member_spec['list_values'] = [item['value'] for item in member_spec['list_values']] member_spec['list_values'] = [{'_struct': 'extensibleattributedef:listvalues', 'value': v} for v in member_spec['list_values']] return member_spec @@ -392,6 +394,11 @@ def run(self, ib_obj_type, ib_spec): if (ib_obj_type == NIOS_EXTENSIBLE_ATTRIBUTE): proposed_object = convert_ea_list_to_struct(proposed_object) + current_object = convert_ea_list_to_struct(current_object) + # Convert 'default_value' to string in both proposed_object and current_object if it exists + for obj in (proposed_object, current_object): + if 'default_value' in obj: + obj['default_value'] = str(obj['default_value']) # checks if the 'text' field has to be updated for the TXT Record if (ib_obj_type == NIOS_TXT_RECORD):