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

reviewable/pr18780/r1
Michael DeHaan 12 years ago
parent 65a0f60c30
commit b0dc015a13

@ -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()

Loading…
Cancel
Save