diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index 4ee777a352..88899e3768 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -44,7 +44,7 @@ def {%- set cable_len = [] %} {%- for local_port in DEVICE_NEIGHBOR %} {%- if local_port == port_name %} - {%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} + {%- if DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor_role = neighbor.type %} {%- set roles1 = switch_role + '_' + neighbor_role %}