Always pipe stderr in the setup module to avoid JSON interference.

This commit is contained in:
Michael DeHaan 2012-09-02 12:34:28 -04:00
parent 7c2fe3da16
commit 8f220a4f77

View file

@ -461,7 +461,7 @@ class LinuxNetwork(Network):
)
interface = dict(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, stderr=subprocess.PIPE).communicate()[0]
if not output:
# v6 routing may result in
# RTNETLINK answers: Invalid argument
@ -484,7 +484,7 @@ class LinuxNetwork(Network):
all_ipv4_addresses = [],
all_ipv6_addresses = [],
)
output = subprocess.Popen([ip_path, 'addr', 'show'], stdout=subprocess.PIPE).communicate()[0]
output = subprocess.Popen([ip_path, 'addr', 'show'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
for line in output.split('\n'):
if line:
words = line.split()