blob: 9e6df557b323f5439de9340d71706a969b77dab2 [file] [log] [blame]
Éric Lemoine1c397442016-11-03 10:54:14 +01001# -*- coding: utf-8 -*-
2
3import re
4
5_alphanum_re = re.compile(r'^[a-z0-9]+$')
6_lo_re = re.compile(r'^lo$')
7
8
9def _filter(interface):
10 return _alphanum_re.match(interface) and not _lo_re.match(interface)
11
12
13def ls():
14 """
15 Provide a list of network interfaces.
16 """
17 return filter(_filter, __salt__['grains.get']('ip_interfaces', {}).keys())