Saltstack Official Linux Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

18 行
355B

  1. # -*- coding: utf-8 -*-
  2. import re
  3. _alphanum_re = re.compile(r'^[a-z0-9]+$')
  4. _lo_re = re.compile(r'^lo$')
  5. def _filter(interface):
  6. return _alphanum_re.match(interface) and not _lo_re.match(interface)
  7. def ls():
  8. """
  9. Provide a list of network interfaces.
  10. """
  11. return filter(_filter, __salt__['grains.get']('ip_interfaces', {}).keys())