adding interfaces_names function to win_network module

This commit is contained in:
ranl 2014-05-07 11:47:24 +03:00
parent c2fa5ae640
commit 66bd7504ce

View File

@ -180,6 +180,25 @@ def dig(host):
return __salt__['cmd.run'](cmd)
def interfaces_names():
'''
Return a list of all the interfaces names
CLI Example:
.. code-block:: bash
salt '*' network.interfaces_names
'''
ret = []
with salt.utils.winapi.Com():
c = wmi.WMI()
for iface in c.Win32_NetworkAdapter(NetEnabled=True):
ret.append(iface.NetConnectionID)
return ret
def interfaces():
'''
Return a dictionary of information about all the interfaces on the minion