Merge pull request #5012 from UtahDave/add_ip4_win

Add ip4 grain for Windows.
This commit is contained in:
Joseph Hall 2013-05-13 14:15:20 -07:00
commit 4ea70b9b85
2 changed files with 6 additions and 5 deletions

View File

@ -834,11 +834,7 @@ def ip4():
Return a list of ipv4 addrs
'''
ips = []
if salt.utils.is_windows():
# TODO: Add windows ip addrs here
pass
else:
ips = salt.utils.socket_util.ip4_addrs()
ips = salt.utils.socket_util.ip4_addrs()
return {'ipv4': ips}

View File

@ -276,6 +276,11 @@ def interfaces():
'''
Return a dictionary of information about all the interfaces on the minion
'''
if salt.utils.is_windows():
from salt.modules.win_network import interfaces as win_interfaces
ifaces = win_interfaces()
return ifaces
ifaces = dict()
if salt.utils.which('ip'):
cmd1 = subprocess.Popen(