mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Fix reserved vlan check + change switchd ifupdown reserved vlan script
to return reserved vlan range from /etc/cumulus/switchd.conf Ticket: CM-4367 Reviewed By: wkok Testing Done: Tested using reserved vlans in old and new bridge (cherry picked from commit 8626feb08703392b29e234b2f81f4df536ad7f7b)
This commit is contained in:
@@ -345,14 +345,9 @@ class bridge(moduleBase):
|
||||
if '-' in part:
|
||||
a, b = part.split('-')
|
||||
a, b = int(a), int(b)
|
||||
if (self._handle_reserved_vlan(a) or
|
||||
self._handle_reserved_vlan(b)):
|
||||
continue
|
||||
result.extend(range(a, b + 1))
|
||||
else:
|
||||
a = int(part)
|
||||
if self._handle_reserved_vlan(a):
|
||||
continue
|
||||
result.append(a)
|
||||
return result
|
||||
|
||||
@@ -594,8 +589,25 @@ class bridge(moduleBase):
|
||||
except Exception, e:
|
||||
self.log_warn(str(e))
|
||||
|
||||
def _check_vids(self, ifaceobj, vids):
|
||||
ret = True
|
||||
for v in vids:
|
||||
if '-' in v:
|
||||
va, vb = v.split('-')
|
||||
va, vb = int(va), int(vb)
|
||||
if (self._handle_reserved_vlan(va, ifaceobj.name) or
|
||||
self._handle_reserved_vlan(vb, ifaceobj.name)):
|
||||
ret = False
|
||||
else:
|
||||
va = int(v)
|
||||
if self._handle_reserved_vlan(va, ifaceobj.name):
|
||||
ret = False
|
||||
return ret
|
||||
|
||||
def _apply_bridge_vids(self, bportifaceobj, vids, running_vids, isbridge):
|
||||
try:
|
||||
if not self._check_vids(bportifaceobj, vids):
|
||||
return
|
||||
if running_vids:
|
||||
(vids_to_del, vids_to_add) = \
|
||||
self._diff_vids(vids, running_vids)
|
||||
|
Reference in New Issue
Block a user