Skip to content

Commit 0d0be72

Browse files
authored
add support for disable_lacp_suspend_individual for non-vpc port-channels (#494)
* add support for disable_lacp_suspend_individual for non-vpc port-channels * modifying test files * Update test_dcnm_intf.py
1 parent ade8131 commit 0d0be72

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

docs/cisco.dcnm.dcnm_interface_module.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,27 @@ Parameters
11461146
<div>Description of the interface</div>
11471147
</td>
11481148
</tr>
1149+
<tr>
1150+
<td class="elbow-placeholder"></td>
1151+
<td class="elbow-placeholder"></td>
1152+
<td colspan="1">
1153+
<div class="ansibleOptionAnchor" id="parameter-"></div>
1154+
<b>disable_lacp_suspend_individual</b>
1155+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
1156+
<div style="font-size: small">
1157+
<span style="color: purple">boolean</span>
1158+
</div>
1159+
</td>
1160+
<td>
1161+
<ul style="margin: 0; padding: 0"><b>Choices:</b>
1162+
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
1163+
<li>yes</li>
1164+
</ul>
1165+
</td>
1166+
<td>
1167+
<div>If disabled, lacp will put the port to individual state and not suspend the port in case the port does not get LACP BPDU from the peer ports in the port-channel</div>
1168+
</td>
1169+
</tr>
11491170
<tr>
11501171
<td class="elbow-placeholder"></td>
11511172
<td class="elbow-placeholder"></td>

plugins/modules/dcnm_interface.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@
196196
- State of Switchport Monitor for SPAN/ERSPAN
197197
type: bool
198198
default: false
199+
disable_lacp_suspend_individual:
200+
description:
201+
- If disabled, lacp will put the port to individual state and not suspend the port
202+
in case the port does not get LACP BPDU from the peer ports in the port-channel
203+
type: bool
204+
default: false
199205
lacp_port_priority:
200206
description:
201207
- <1-65535> Set LACP port priority on member interfaces, default is 32768
@@ -2348,6 +2354,7 @@ def dcnm_intf_validate_port_channel_input(self, config):
23482354
enable_pfc=dict(type="bool", default=False),
23492355
duplex=dict(
23502356
type="str", default="auto", choices=["auto", "full", "half"]),
2357+
disable_lacp_suspend_individual=dict(type="bool", default=False),
23512358
lacp_port_priority=dict(type="int", default=32768, range_min=1, range_max=65535),
23522359
lacp_rate=dict(type="str", default="normal"),
23532360
)
@@ -2370,6 +2377,7 @@ def dcnm_intf_validate_port_channel_input(self, config):
23702377
enable_pfc=dict(type="bool", default=False),
23712378
duplex=dict(
23722379
type="str", default="auto", choices=["auto", "full", "half"]),
2380+
disable_lacp_suspend_individual=dict(type="bool", default=False),
23732381
lacp_port_priority=dict(type="int", default=32768, range_min=1, range_max=65535),
23742382
lacp_rate=dict(type="str", default="normal"),
23752383
)
@@ -2946,6 +2954,10 @@ def dcnm_intf_get_pc_payload(self, delem, intf, profile):
29462954
"ENABLE_MONITOR"] = delem[profile]["enable_monitor"]
29472955
intf["interfaces"][0]["nvPairs"][
29482956
"PORT_DUPLEX_MODE"] = delem[profile]["duplex"]
2957+
if delem[profile].get("disable_lacp_suspend_individual"):
2958+
intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = delem[profile]["disable_lacp_suspend_individual"]
2959+
else:
2960+
intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = False
29492961
if delem[profile].get("lacp_port_priority"):
29502962
intf["interfaces"][0]["nvPairs"]["LACP_PORT_PRIO"] = delem[profile]["lacp_port_priority"]
29512963
else:
@@ -2987,6 +2999,10 @@ def dcnm_intf_get_pc_payload(self, delem, intf, profile):
29872999
"ENABLE_MONITOR"] = delem[profile]["enable_monitor"]
29883000
intf["interfaces"][0]["nvPairs"][
29893001
"PORT_DUPLEX_MODE"] = delem[profile]["duplex"]
3002+
if delem[profile].get("disable_lacp_suspend_individual"):
3003+
intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = delem[profile]["disable_lacp_suspend_individual"]
3004+
else:
3005+
intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = False
29903006
if delem[profile].get("lacp_port_priority"):
29913007
intf["interfaces"][0]["nvPairs"]["LACP_PORT_PRIO"] = delem[profile]["lacp_port_priority"]
29923008
else:

tests/unit/modules/dcnm/test_dcnm_intf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,7 @@ def test_dcnm_intf_pc_replaced_existing(self):
29972997
"ROUTING_TAG",
29982998
"SPEED",
29992999
"CONF",
3000+
"DISABLE_LACP_SUSPEND",
30003001
"LACP_PORT_PRIO",
30013002
"LACP_RATE"
30023003
]

0 commit comments

Comments
 (0)