View | Details | Raw Unified | Return to bug 25463 | Differences between
and this patch

Collapse All | Expand All

(-)modules/univention/admin/syntax.py (-2 / +8 lines)
 Lines 1081-1088    Link Here 
1081
	choices = ( ( 'ethernet', _( 'Ethernet' ) ), ( 'fddi', _( 'FDDI' ) ), ( 'token-ring', _( 'Token-Ring' ) ) )
1081
	choices = ( ( 'ethernet', _( 'Ethernet' ) ), ( 'fddi', _( 'FDDI' ) ), ( 'token-ring', _( 'Token-Ring' ) ) )
1082
1082
1083
class MAC_Address( simple ):
1083
class MAC_Address( simple ):
1084
	regex = re.compile( '^([0-9a-fA-F]{1,2}[:-]){5}[0-9a-fA-F]{1,2}$' )
1084
	regexFormats = (
1085
	error_message = _( 'This is not a valid MAC address. It must have 6 two digit hexadecimal numbers separated by \"-\" or \":\"' )
1085
		'(([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})', # linux format
1086
		'(([0-9a-fA-F]{2}-){5}[0-9a-fA-F]{2})', # windows format
1087
		'([0-9a-fA-F]{12})', # raw format
1088
		'(([0-9a-fA-F]{4}.){2}[0-9a-fA-F]{4})', # cisco format
1089
	)
1090
	regex = re.compile( '^(' + '|'.join(regexFormats) + ')$' )
1091
	error_message = _( 'This is not a valid MAC address.' )
1086
	size = 'TwoThirds'
1092
	size = 'TwoThirds'
1087
1093
1088
	@classmethod
1094
	@classmethod

Return to bug 25463