1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons/bridge.py: fixing potential None type issue

This commit is contained in:
Julien Fortin
2016-03-29 04:29:24 +02:00
parent 0c79210304
commit 4ab0c044cb

View File

@@ -226,7 +226,7 @@ class bridge(moduleBase):
def _get_ifaceobj_bridge_ports(self, ifaceobj):
ports = ifaceobj.get_attr_value('bridge-ports')
if len(ports) > 1:
if ports and len(ports) > 1:
self.log_warn('%s: ignoring duplicate bridge-ports lines: %s'
%(ifaceobj.name, ports[1:]))
return ports[0] if ports else None