Skip to content

[minigraph.py] Crashes upon <DhcpRelays></DhcpRelays> in VlanInterface section #1302

@taoyl-ms

Description

@taoyl-ms

Description
In minigraph.py:

            if vintf.find(str(QName(ns, "DhcpRelays"))) is not None:
                vintfdhcpservers = vintf.find(str(QName(ns, "DhcpRelays"))).text
                vdhcpserver_list = vintfdhcpservers.split(';')
                vlan_attributes['dhcp_servers'] = vdhcpserver_list

This will crash upon case of <DhcpRelays></DhcpRelays>, i.e. vintf.find(str(QName(ns, "DhcpRelays"))) is not None but vintf.find(str(QName(ns, "DhcpRelays"))).text is None.

Steps to reproduce the issue:
Create a minigraph with <DhcpRelays></DhcpRelays> in <VlanInterface> section, then sonic-cfggen -m.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions