mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Change case of check strings
Ticket: CM-3346 Reviewed By: cosmetic Testing Done: ifquery check sanity
This commit is contained in:
@ -336,15 +336,6 @@ class bridge(moduleBase):
|
|||||||
b = list(b)
|
b = list(b)
|
||||||
yield b[0][1], b[-1][1]
|
yield b[0][1], b[-1][1]
|
||||||
|
|
||||||
def _handle_reserved_vlan(self, vlanid):
|
|
||||||
if vlanid in range(self._resv_vlan_range[0],
|
|
||||||
self._resv_vlan_range[1]):
|
|
||||||
self.logger.warn('skipping reserved vlan %d' %vlanid +
|
|
||||||
' (reserved vlan range %d-%d)' %(self._resv_vlan_range[0],
|
|
||||||
self._resv_vlan_range[1]))
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def _ranges_to_ints(self, rangelist):
|
def _ranges_to_ints(self, rangelist):
|
||||||
""" returns expanded list of integers given set of string ranges
|
""" returns expanded list of integers given set of string ranges
|
||||||
example: ['1', '2-4', '6'] returns [1, 2, 3, 4, 6]
|
example: ['1', '2-4', '6'] returns [1, 2, 3, 4, 6]
|
||||||
|
@ -124,6 +124,8 @@ class vlan(moduleBase):
|
|||||||
vlanid = self._get_vlan_id(ifaceobj)
|
vlanid = self._get_vlan_id(ifaceobj)
|
||||||
if vlanid == -1:
|
if vlanid == -1:
|
||||||
raise Exception('could not determine vlanid')
|
raise Exception('could not determine vlanid')
|
||||||
|
if self._handle_reserved_vlan(vlanid):
|
||||||
|
return
|
||||||
vlanrawdevice = self._get_vlan_raw_device(ifaceobj)
|
vlanrawdevice = self._get_vlan_raw_device(ifaceobj)
|
||||||
if not vlanrawdevice:
|
if not vlanrawdevice:
|
||||||
raise Exception('could not determine vlan raw device')
|
raise Exception('could not determine vlan raw device')
|
||||||
|
@ -23,8 +23,8 @@ multiple_vlan_aware_bridge_support=0
|
|||||||
# cross marks against interface attributes.
|
# cross marks against interface attributes.
|
||||||
# Use the below strings to modify the default behaviour.
|
# Use the below strings to modify the default behaviour.
|
||||||
#
|
#
|
||||||
ifquery_check_success_str=(OK)
|
ifquery_check_success_str=(ok)
|
||||||
ifquery_check_error_str=(FAIL)
|
ifquery_check_error_str=(fail)
|
||||||
ifquery_check_unknown_str=
|
ifquery_check_unknown_str=
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -336,3 +336,14 @@ class moduleBase(object):
|
|||||||
# ignore errors
|
# ignore errors
|
||||||
pass
|
pass
|
||||||
return (start, end)
|
return (start, end)
|
||||||
|
|
||||||
|
def _handle_reserved_vlan(self, vlanid):
|
||||||
|
""" Helper function to check and warn if the vlanid falls in the
|
||||||
|
reserved vlan range """
|
||||||
|
if vlanid in range(self._resv_vlan_range[0],
|
||||||
|
self._resv_vlan_range[1]):
|
||||||
|
self.logger.warn('skipping reserved vlan %d' %vlanid +
|
||||||
|
' (reserved vlan range %d-%d)' %(self._resv_vlan_range[0],
|
||||||
|
self._resv_vlan_range[1]))
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
Reference in New Issue
Block a user