diff --git a/config/main.py b/config/main.py index 966831001979..afdf6634fe84 100755 --- a/config/main.py +++ b/config/main.py @@ -526,14 +526,14 @@ def warm_restart(ctx, redis_unix_socket_path): pass @warm_restart.command('enable') -@click.argument('module', metavar='', default='system', required=False, type=click.Choice(["system", "swss"])) +@click.argument('module', metavar='', default='system', required=False, type=click.Choice(["system", "swss", "bgp"])) @click.pass_context def warm_restart_enable(ctx, module): db = ctx.obj['db'] db.mod_entry('WARM_RESTART', module, {'enable': 'true'}) @warm_restart.command('disable') -@click.argument('module', metavar='', default='system', required=False, type=click.Choice(["system", "swss"])) +@click.argument('module', metavar='', default='system', required=False, type=click.Choice(["system", "swss", "bgp"])) @click.pass_context def warm_restart_enable(ctx, module): db = ctx.obj['db'] @@ -548,6 +548,15 @@ def warm_restart_neighsyncd_timer(ctx, seconds): ctx.fail("neighsyncd warm restart timer must be in range 1-9999") db.mod_entry('WARM_RESTART', 'swss', {'neighsyncd_timer': seconds}) +@warm_restart.command('bgp_timer') +@click.argument('seconds', metavar='', required=True, type=int) +@click.pass_context +def warm_restart_bgp_timer(ctx, seconds): + db = ctx.obj['db'] + if seconds not in range(1,3600): + ctx.fail("bgp warm restart timer must be in range 1-3600") + db.mod_entry('WARM_RESTART', 'bgp', {'bgp_timer': seconds}) + # # 'vlan' group ('config vlan ...') # diff --git a/show/main.py b/show/main.py index 92065c6b2668..0ff39c331239 100755 --- a/show/main.py +++ b/show/main.py @@ -1663,6 +1663,9 @@ def tablelize(keys, data): if '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']) else: r.append("NULL") r.append("NULL")