mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Simple regex fix for Linux aliases and VLAN tags
This commit is contained in:
parent
8de4dbc13d
commit
daae29adf6
@ -84,7 +84,7 @@ def _interfaces_ip():
|
|||||||
for line in group.split('\n'):
|
for line in group.split('\n'):
|
||||||
if not ' ' in line:
|
if not ' ' in line:
|
||||||
continue
|
continue
|
||||||
m = re.match('^\d*:\s+(\w+)(?:@)?(\w+)?:\s+<(.+)>', line)
|
m = re.match('^\d*:\s+([\w.]+)(?:@)?(\w+)?:\s+<(.+)>', line)
|
||||||
if m:
|
if m:
|
||||||
iface,parent,attrs = m.groups()
|
iface,parent,attrs = m.groups()
|
||||||
if 'UP' in attrs.split(','):
|
if 'UP' in attrs.split(','):
|
||||||
@ -145,7 +145,7 @@ def _interfaces_ifconfig():
|
|||||||
'''
|
'''
|
||||||
ret = {}
|
ret = {}
|
||||||
|
|
||||||
piface = re.compile('^(\w+)')
|
piface = re.compile('^(\S+):?')
|
||||||
pmac = re.compile('.*?(?:HWaddr|ether) ([0-9a-fA-F:]+)')
|
pmac = re.compile('.*?(?:HWaddr|ether) ([0-9a-fA-F:]+)')
|
||||||
pip = re.compile('.*?(?:inet addr:|inet )(.*?)\s')
|
pip = re.compile('.*?(?:inet addr:|inet )(.*?)\s')
|
||||||
pip6 = re.compile('.*?(?:inet6 addr: (.*?)/|inet6 )([0-9a-fA-F:]+)')
|
pip6 = re.compile('.*?(?:inet6 addr: (.*?)/|inet6 )([0-9a-fA-F:]+)')
|
||||||
|
Loading…
Reference in New Issue
Block a user