From 62f330ef549cffef8ad4440a5abed75ca916c42b Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Wed, 5 Sep 2018 15:29:31 -0700 Subject: [PATCH 1/3] Update sonic-swss. vxlan enhancements --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 58a644794a26..29722e115b01 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 58a644794a2650599e1102425f3903f56ff53835 +Subproject commit 29722e115b019678219ad284457663fa1c947ff5 From ff73aecb626f6b535eb242332dafc6ae3ceceb45 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Mon, 15 Oct 2018 13:06:14 -0700 Subject: [PATCH 2/3] Check that we have dhcprelays text before using it --- src/sonic-config-engine/minigraph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index a72eed754b8c..1af5adc95371 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -211,7 +211,8 @@ 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: + if vintf.find(str(QName(ns, "DhcpRelays"))) is not None and + vintf.find(str(QName(ns, "DhcpRelays"))).text is not None: vintfdhcpservers = vintf.find(str(QName(ns, "DhcpRelays"))).text vdhcpserver_list = vintfdhcpservers.split(';') vlan_attributes['dhcp_servers'] = vdhcpserver_list From 6e465da8ece111c872b3a903a76edc55c3de5f88 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Mon, 15 Oct 2018 15:18:34 -0700 Subject: [PATCH 3/3] Add additional variable to avoid extracting node again and again --- src/sonic-config-engine/minigraph.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 1af5adc95371..bfb478ba381b 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -211,9 +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 and - vintf.find(str(QName(ns, "DhcpRelays"))).text 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