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

pull/992/head
Michael DeHaan 12 years ago
parent 7c2fe3da16
commit 8f220a4f77

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

Loading…
Cancel
Save