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.
This commit is contained in:
anamehra 2023-09-13 14:10:56 -07:00 committed by GitHub
parent 42126ccf7d
commit 78981d93b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,7 @@ dependent_startup=true
dependent_startup_wait_for=rsyslogd:running dependent_startup_wait_for=rsyslogd:running
{% endif %} {% 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 %} {% if not skip_ycabled %}
[program:ycabled] [program:ycabled]
{% if delay_ycabled %} {% if delay_ycabled %}