Skip to content

Commit

Permalink
[interfaces] correctly enable interfaces on N3K (#813)
Browse files Browse the repository at this point in the history
Signed-off-by: NilashishC <[email protected]>
  • Loading branch information
NilashishC authored Feb 6, 2024
1 parent 1882f7c commit 3a65be4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_749.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "nxos_interfaces - Correctly enable L3 interfaces on supported N3K platforms (https://github.com/ansible-collections/cisco.nxos/issues/749)."
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,13 @@ def render_interface_defaults(self, config, intfs):
and enabled/shutdown states. The default values for user-defined-default
configurations may be different for legacy platforms.
Notes:
- L3 enabled default state is False on N9K,N7K but True for N3K,N6K
- L3 enabled default state is False on N9K,N7K,N3K but True for N5K,N6K
- Changing L2-L3 modes may change the default enabled value.
- '(no) system default switchport shutdown' only applies to L2 interfaces.
Run through the gathered interfaces and tag their default enabled state.
"""
intf_defs = {}
L3_enabled = True if re.search("N[356]K", self.get_platform()) else False
L3_enabled = True if re.search("N[56]K", self.get_platform()) else False
intf_defs = {
"sysdefs": {
"mode": None,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/network/nxos/test_nxos_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def load_fixtures(self, commands=None, device=""):
self.edit_config.return_value = None
if device == "legacy":
# call execute_module() with device='legacy' to use this codepath
self.get_platform.return_value = "N3K-Cxxx"
self.get_platform.return_value = "N5K-Cxxx"
else:
self.get_platform.return_value = "N9K-Cxxx"

Expand Down

0 comments on commit 3a65be4

Please sign in to comment.