Skip to content

Commit

Permalink
Merged PR 3775436: Make internal templates compatible with python3 ji…
Browse files Browse the repository at this point in the history
…nja2

python3 jinja2 doesn't support .has_key()
  • Loading branch information
pavel-shirshov authored and abdosi committed May 19, 2022
1 parent d03bc5f commit 2cdcf19
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 2cdcf19

Please sign in to comment.