Merge pull request #9490 from yannj-fr/develop

Adding hwaddr_interfaces to grains, it permit to target minion based on ...
This commit is contained in:
Thomas S Hatch 2013-12-30 10:20:07 -08:00
commit f6048017f7

View File

@ -1079,6 +1079,20 @@ def ip_interfaces():
return {'ip_interfaces': ret}
def hwaddr_interfaces():
'''
Provide a dict of the connected interfaces and their hw addresses (Mac Address)
'''
# Provides:
# hwaddr_interfaces
ret = {}
ifaces = salt.utils.network.interfaces()
for face in ifaces:
if 'hwaddr' in ifaces[face]:
ret[face] = ifaces[face]['hwaddr']
return {'hwaddr_interfaces': ret}
def path():
'''
Return the path