1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #884 from cybertoast/feature/882-interfaces

Feature/882 interfaces
This commit is contained in:
Michael DeHaan 2012-08-15 16:31:17 -07:00
commit 7e357fce45

View file

@ -467,6 +467,10 @@ class LinuxNetwork(Network):
interface = dict(v4 = {}, v6 = {}) interface = dict(v4 = {}, v6 = {})
for v in 'v4', 'v6': for v in 'v4', 'v6':
output = subprocess.Popen(command[v], stdout=subprocess.PIPE).communicate()[0] output = subprocess.Popen(command[v], stdout=subprocess.PIPE).communicate()[0]
if not output:
# v6 routing may result in
# RTNETLINK answers: Invalid argument
continue
words = output.split('\n')[0].split() words = output.split('\n')[0].split()
# A valid output starts with the queried address on the first line # A valid output starts with the queried address on the first line
if words[0] == command[v][-1]: if words[0] == command[v][-1]: