[minigraph]: Do not fail for minigraphs which do not have neighbors listed in <Devices> section (#2522)

Signed-off-by: Nadiya.Stetskovych <nstetskovych@barefootnetworks.com>
This commit is contained in:
Nadiia Stetskovych 2019-02-05 08:43:08 +02:00 committed by Ying Xie
parent 1ddf4b75c9
commit 4998609c2f

View File

@ -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 %}