mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: bridge: identify a bridge with bridge-ports or bridge-vlan-aware keywords
Ticket: CM-14158 Reviewed By: julien, nikhilg Testing Done: Tested with a bridge config without bridge-ports line. NCLU wants the ability to create a bridge without ports (to add them later). Today we cannot specify an attribute without values. We get the below error: info: processing interfaces file /etc/network/interfaces error: /etc/network/interfaces: line10: iface bridge: invalid syntax 'bridge-ports' The error comes from a generic parser check...we will need to add exceptions to the generic check if we allow attributes without values. This patch simply identifies a bridge by both the bridge-vlan-aware and bridge-ports keyword. For vlan aware bridge it will simply work. For old bridge driver nclu will have to specify 'bridge-vlan-aware no' to achieve the same. nclu does not support old bridge model today, so defering the old bridge driver discussion for later. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
@@ -303,7 +303,8 @@ class bridge(moduleBase):
|
||||
return True
|
||||
|
||||
def _is_bridge(self, ifaceobj):
|
||||
if ifaceobj.get_attr_value_first('bridge-ports'):
|
||||
if (ifaceobj.get_attr_value_first('bridge-ports') or
|
||||
ifaceobj.get_attr_value_first('bridge-vlan-aware')):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
Reference in New Issue
Block a user