From 2cdcf1994f74bfca4b9505c490b1fb9b76b0e92f Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Thu, 12 Nov 2020 01:03:45 +0000 Subject: [PATCH] Merged PR 3775436: Make internal templates compatible with python3 jinja2 python3 jinja2 doesn't support .has_key() --- .../frr/bgpd/templates/msft.general/instance.conf.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/msft.general/instance.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/msft.general/instance.conf.j2 index 19bb00c08de2..fd574f1f065f 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/msft.general/instance.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/msft.general/instance.conf.j2 @@ -3,9 +3,9 @@ ! {% set need_to_set_timers = (bgp_session['keepalive'] is defined and bgp_session['keepalive'] | int != 60) or (bgp_session['holdtime'] is defined and bgp_session['holdtime'] | int != 180) %} -{% set need_to_shutdown = bgp_session.has_key('admin_status') and bgp_session['admin_status'] == 'down' or - not bgp_session.has_key('admin_status') and - CONFIG_DB__DEVICE_METADATA['localhost'].has_key('default_bgp_status') and +{% set need_to_shutdown = 'admin_status' in bgp_session and bgp_session['admin_status'] == 'down' or + 'admin_status' not in bgp_session and + 'default_bgp_status' in CONFIG_DB__DEVICE_METADATA['localhost'] and CONFIG_DB__DEVICE_METADATA['localhost']['default_bgp_status'] == 'down' and CONFIG_DB__DEVICE_METADATA.localhost.type == 'LeafRouter' %} {% from "bgpd/templates/msft.general/router.j2" import general_routing with context %}