From b0dc015a13de69766022c6d3f3f4eb847e49ce4d Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 2 Sep 2012 12:34:28 -0400 Subject: [PATCH] Always pipe stderr in the setup module to avoid JSON interference. --- setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup b/setup index 005919157b1..89231a1b224 100755 --- a/setup +++ b/setup @@ -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()