Skip to content

Commit 5dcdb48

Browse files
authored
[pytest/lacp]: use lacp timer if lacp rate cmd is not available (#2488)
eos has deprecated lacp rate cmd in latest eos Fix #2041 Signed-off-by: Guohan Lu <[email protected]>
1 parent b3fd4f8 commit 5dcdb48

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/common/devices.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,18 @@ def set_interface_lacp_rate_mode(self, interface_name, mode):
11401140
out = self.eos_config(
11411141
lines=['lacp rate %s' % mode],
11421142
parents='interface %s' % interface_name)
1143-
logging.info("Set interface [%s] lacp rate to [%s]" % (interface_name, mode))
1143+
if out['changed'] == False:
1144+
# new eos deprecate lacp rate and use lacp timer command
1145+
out = self.eos_config(
1146+
lines=['lacp timer %s' % mode],
1147+
parents='interface %s' % interface_name)
1148+
if out['changed'] == False:
1149+
logging.warning("Unable to set interface [%s] lacp timer to [%s]" % (interface_name, mode))
1150+
raise Exception("Unable to set interface [%s] lacp timer to [%s]" % (interface_name, mode))
1151+
else:
1152+
logging.info("Set interface [%s] lacp timer to [%s]" % (interface_name, mode))
1153+
else:
1154+
logging.info("Set interface [%s] lacp rate to [%s]" % (interface_name, mode))
11441155
return out
11451156

11461157
def kill_bgpd(self):

0 commit comments

Comments
 (0)