From 2c0af8af33b05e7cfa68f08e0b6f5baf39c0b451 Mon Sep 17 00:00:00 2001 From: heidinet2007 <43017482+heidinet2007@users.noreply.github.com> Date: Thu, 7 Nov 2019 12:25:35 -0800 Subject: [PATCH] Add an on/off knob for BGP EOIU pulling on warm restart (#655) --- config/main.py | 7 +++++++ show/main.py | 20 ++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/config/main.py b/config/main.py index 134d4ecdd024..953bf65a9b97 100755 --- a/config/main.py +++ b/config/main.py @@ -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='', 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 ...') # diff --git a/show/main.py b/show/main.py index 7280ce6e96a4..adee9d138dd3 100755 --- a/show/main.py +++ b/show/main.py @@ -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)