mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
adding interfaces_names function to win_network module
This commit is contained in:
parent
c2fa5ae640
commit
66bd7504ce
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user