mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Add network.hwaddr function
This function was part of salt in the past but was removed when the output from network.interfaces was refactored a while back. This commit adds it back.
This commit is contained in:
parent
572db25c3c
commit
65eeaa9733
@ -239,6 +239,17 @@ def interfaces():
|
||||
return ifaces
|
||||
|
||||
|
||||
def hwaddr(iface):
|
||||
'''
|
||||
Return the hardware address (a.k.a. MAC address) for a given interface
|
||||
|
||||
CLI Example::
|
||||
|
||||
salt '*' network.hwaddr eth0
|
||||
'''
|
||||
return interfaces().get(iface, {}).get('hwaddr', '')
|
||||
|
||||
|
||||
def _get_net_start(ipaddr, netmask):
|
||||
ipaddr_octets = ipaddr.split('.')
|
||||
netmask_octets = netmask.split('.')
|
||||
|
Loading…
Reference in New Issue
Block a user