diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index a72eed754b8c..bfb478ba381b 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -211,8 +211,9 @@ def parse_dpg(dpg, hname): # If this VLAN requires a DHCP relay agent, it will contain a element # containing a list of DHCP server IPs - if vintf.find(str(QName(ns, "DhcpRelays"))) is not None: - vintfdhcpservers = vintf.find(str(QName(ns, "DhcpRelays"))).text + vintf_node = vintf.find(str(QName(ns, "DhcpRelays"))) + if vintf_node is not None and vintf_node.text is not None: + vintfdhcpservers = vintf_node.text vdhcpserver_list = vintfdhcpservers.split(';') vlan_attributes['dhcp_servers'] = vdhcpserver_list