mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
clean up net validator
A few issues, overloaded function, and bitwise whitespace
This commit is contained in:
parent
ad44000948
commit
9ead14c18e
@ -3,9 +3,11 @@
|
||||
Various network validation utilities
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
import re
|
||||
|
||||
def mac(mac):
|
||||
|
||||
def mac(addr):
|
||||
'''
|
||||
Validates a mac address
|
||||
'''
|
||||
@ -13,5 +15,5 @@ def mac(mac):
|
||||
(^([0-9A-F]{1,2}[-]){5}([0-9A-F]{1,2})$
|
||||
|^([0-9A-F]{1,2}[:]){5}([0-9A-F]{1,2})$)
|
||||
''',
|
||||
re.VERBOSE|re.IGNORECASE)
|
||||
return valid.match(mac) is not None
|
||||
re.VERBOSE | re.IGNORECASE)
|
||||
return valid.match(addr) is not None
|
||||
|
Loading…
Reference in New Issue
Block a user