1
0
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:
Roopa Prabhu
2014-11-28 12:48:01 -08:00
parent 44d3bb5b9d
commit a3b9ac1e99
4 changed files with 15 additions and 11 deletions

View File

@ -336,15 +336,6 @@ class bridge(moduleBase):
b = list(b)
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):
""" returns expanded list of integers given set of string ranges
example: ['1', '2-4', '6'] returns [1, 2, 3, 4, 6]

View File

@ -124,6 +124,8 @@ class vlan(moduleBase):
vlanid = self._get_vlan_id(ifaceobj)
if vlanid == -1:
raise Exception('could not determine vlanid')
if self._handle_reserved_vlan(vlanid):
return
vlanrawdevice = self._get_vlan_raw_device(ifaceobj)
if not vlanrawdevice:
raise Exception('could not determine vlan raw device')

View File

@ -23,8 +23,8 @@ multiple_vlan_aware_bridge_support=0
# cross marks against interface attributes.
# Use the below strings to modify the default behaviour.
#
ifquery_check_success_str=(OK)
ifquery_check_error_str=(FAIL)
ifquery_check_success_str=(ok)
ifquery_check_error_str=(fail)
ifquery_check_unknown_str=
#

View File

@ -336,3 +336,14 @@ class moduleBase(object):
# ignore errors
pass
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