Skip to content

Commit

Permalink
[FIX] NPA-73, Re-execution showing change for each execution. (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
JkhatriInfobox authored Jul 12, 2024
1 parent e23c87c commit 2f75ead
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/module_utils/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 2f75ead

Please sign in to comment.