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

dcnm_fabric: Fix for issue 343 #344

Merged
merged 3 commits into from
Nov 16, 2024
Merged

dcnm_fabric: Fix for issue 343 #344

merged 3 commits into from
Nov 16, 2024

Conversation

allenrobel
Copy link
Collaborator

@allenrobel allenrobel commented Nov 16, 2024

Summary

Fixes an issue found by Alessandro De Prato where Ansible-created external fabrics (e.g. ISN) are displayed with incorrect Fabric Type column value in the NDFC GUI on page:

NDFC -> Manage -> Fabrics

Details

For example, ISN fabric types are displayed with a column value of "Custom Fabric" but SHOULD be displayed with a column value of "Multi-Site External Network".

The reason is that the NDFC GUI adds the key EXT_FABRIC_TYPE to the payload with the value (in the case of ISN) of "Multi-Site External Network".

This only affects fabrics using the External_Fabric template.

Testing

I've tested to verify the fix and have tested to verify that the fix does not change behavior for non-External fabric types.

Other

Have made the fix extensible, so that it can be applied to other fabric types that use the External_Fabric template, should we decide to add them.

Resolves

#343

1. module_utils/fabric/create.py

Modify the payload for external fabric types to include EXT_FABRIC_TYPE key with value being the default value that the NDFC GUI uses to display the fabric type.

2. module_utils/fabric/fabric_types.py

Add a mapping between external fabric types and the string NDFC uses when  displaying the fabric type.
1. plugins/module_utils/fabric/create.py

a. Change the method name _fixup_payload_ext_fabric_type() to _add_ext_fabric_type_to_payload()

b. Add a log message in _add_ext_fabric_type_to_payload() when a payload has been modified.
1. module_utils.fabric/fabric_types.py

Edit comment to mention that the private set is exposed via property external_fabric_types.
@allenrobel allenrobel self-assigned this Nov 16, 2024
@allenrobel allenrobel requested a review from mikewiebe November 16, 2024 00:59
@allenrobel allenrobel added the ready for review PR is ready to be reviewed label Nov 16, 2024
@mikewiebe mikewiebe merged commit 859dd52 into develop Nov 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dcnm_fabric: External fabric types should add EXT_FABRIC_TYPE to the POST request payload.
2 participants