Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] NPA-73, Re-execution showing change for each execution. #240

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading