Skip to content

Commit

Permalink
Add an on/off knob for BGP EOIU pulling on warm restart (sonic-net#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
heidinet2007 authored and yxieca committed Nov 7, 2019
1 parent 2bce9ce commit 2c0af8a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
7 changes: 7 additions & 0 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,13 @@ def warm_restart_teamsyncd_timer(ctx, seconds):
ctx.fail("teamsyncd warm restart timer must be in range 1-3600")
db.mod_entry('WARM_RESTART', 'teamd', {'teamsyncd_timer': seconds})

@warm_restart.command('bgp_eoiu')
@click.argument('enable', metavar='<enable>', default='true', required=False, type=click.Choice(["true", "false"]))
@click.pass_context
def warm_restart_bgp_eoiu(ctx, enable):
db = ctx.obj['db']
db.mod_entry('WARM_RESTART', 'bgp', {'bgp_eoiu': enable})

#
# 'vlan' group ('config vlan ...')
#
Expand Down
20 changes: 16 additions & 4 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2304,24 +2304,36 @@ def tablelize(keys, data, enable_table_keys, prefix):
if k not in data:
r.append("NULL")
r.append("NULL")
r.append("NULL")
elif 'neighsyncd_timer' in data[k]:
r.append("neighsyncd_timer")
r.append(data[k]['neighsyncd_timer'])
elif 'bgp_timer' in data[k]:
r.append("bgp_timer")
r.append(data[k]['bgp_timer'])
r.append("NULL")
elif 'bgp_timer' in data[k] or 'bgp_eoiu' in data[k]:
if 'bgp_timer' in data[k]:
r.append("bgp_timer")
r.append(data[k]['bgp_timer'])
else:
r.append("NULL")
r.append("NULL")
if 'bgp_eoiu' in data[k]:
r.append(data[k]['bgp_eoiu'])
else:
r.append("NULL")
elif 'teamsyncd_timer' in data[k]:
r.append("teamsyncd_timer")
r.append(data[k]['teamsyncd_timer'])
r.append("NULL")
else:
r.append("NULL")
r.append("NULL")
r.append("NULL")

table.append(r)

return table

header = ['name', 'enable', 'timer_name', 'timer_duration']
header = ['name', 'enable', 'timer_name', 'timer_duration', 'eoiu_enable']
click.echo(tabulate(tablelize(keys, data, enable_table_keys, prefix), header))
state_db.close(state_db.STATE_DB)

Expand Down

0 comments on commit 2c0af8a

Please sign in to comment.