blob: 52d8a1ddb3095849b90c92e19df89ead69b03b5b [file] [log] [blame]
# -*- coding: utf-8 -*-
import re
def ls(regex):
"""
Provide a list of network interfaces.
"""
_lo_re = re.compile(r'^lo$')
_alphanum_re = re.compile(regex)
def _filter(interface):
return _alphanum_re.match(interface) and not _lo_re.match(interface)
return filter(_filter, __salt__['grains.get']('ip_interfaces', {}).keys())