Skip to content

Commit

Permalink
[minigraph.py]: Check for empty cluster tag before parsing (#6440)
Browse files Browse the repository at this point in the history
Some non-production minigraphs will have an empty ClusterName tag

Signed-off-by: Lawrence Lee <[email protected]>
  • Loading branch information
theasianpianist authored and lguohan committed Jan 15, 2021
1 parent 21d4df3 commit 4f6e161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def parse_png(png, hname, dpg_ecmp_content = None):
if name == hname:
cluster = device.find(str(QName(ns, "ClusterName")))

if cluster != None and "str" in cluster.text.lower():
if cluster != None and cluster.text != None and "str" in cluster.text.lower():
is_storage_device = True

if child.tag == str(QName(ns, "DeviceInterfaceLinks")):
Expand Down

0 comments on commit 4f6e161

Please sign in to comment.