From 3bca122b29fa9e143598c9dd5c8a56b7bbbcb5a6 Mon Sep 17 00:00:00 2001 From: anamehra <54692434+anamehra@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:10:56 -0700 Subject: [PATCH] Chassis: fix pmon docker failure when DEVICE_METADATA is not available (#16527) Signed-off-by: anamehra anamehra@cisco.com Added a check for DEVICE_METADATA before accessing the data. This prevents the j2 failure when var is not available. --- dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index d8769097f..899160dd3 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -112,7 +112,7 @@ dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% endif %} -{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} +{% if DEVICE_METADATA and 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} {% if not skip_ycabled %} [program:ycabled] {% if delay_ycabled %}