Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1329,9 +1329,14 @@ def portchannel_member(ctx):
def add_portchannel_member(ctx, portchannel_name, port_name):
"""Add member to port channel"""
db = ctx.obj['db']
portchannel_member_table = db.get_table('PORTCHANNEL_MEMBER')
if clicommon.is_port_mirror_dst_port(db, port_name):
ctx.fail("{} is configured as mirror destination port".format(port_name))

# Check if the member interface given by user is already used.
if interface_is_in_portchannel(portchannel_member_table, port_name) is True:
ctx.fail("Interface is already member of portchannel!")

# Check if the member interface given by user is valid in the namespace.
if interface_name_is_valid(db, port_name) is False:
ctx.fail("Interface name is invalid. Please enter a valid interface name!!")
Expand Down
7 changes: 5 additions & 2 deletions scripts/intfutil
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,11 @@ def po_speed_dict(po_int_dict, appl_db):
po_list.append(key)
if len(value) == 1:
interface_speed = appl_db.get(appl_db.APPL_DB, "PORT_TABLE:" + value[0], "speed")
interface_speed = '{}G'.format(interface_speed[:-3])
po_list.append(interface_speed)
if interface_speed == None:
po_list.append("N/A")
else:
interface_speed = '{}G'.format(interface_speed[:-3])
po_list.append(interface_speed)
elif len(value) > 1:
for intf in value:
temp_speed = appl_db.get(appl_db.APPL_DB, "PORT_TABLE:" + intf, "speed")
Expand Down