From b852f2274b9dc179ffb636091d80d1bb5e90841d Mon Sep 17 00:00:00 2001
From: clayg <clay.gerrard@gmail.com>
Date: Mon, 26 Nov 2012 12:28:33 -0800
Subject: [PATCH] capture resetswift output in probetests

This change makes the dots prettier during probetests

When calling the resetswift script, the probetests will use subprocess
to redirect stderr to stdout and capture stdout into a buffer.  We print
the captured buffer from resetswift's combined stdout/stderr and let
nosetests stdout capturing handle printing the output for debug only if a
test fails.

Change-Id: I022512f2ef5a4c43b0e49264bad1bca98c1f0299
---
 test/probe/common.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/probe/common.py b/test/probe/common.py
index 3433cd6c22..f376f6f915 100644
--- a/test/probe/common.py
+++ b/test/probe/common.py
@@ -16,7 +16,7 @@
 from httplib import HTTPConnection
 from os import kill
 from signal import SIGTERM
-from subprocess import call, Popen
+from subprocess import Popen, PIPE, STDOUT
 from time import sleep, time
 
 from swiftclient import get_auth, head_account
@@ -122,7 +122,9 @@ def kill_nonprimary_server(primary_nodes, port2server, pids):
 
 
 def reset_environment():
-    call(['resetswift'])
+    p = Popen("resetswift 2>&1", shell=True, stdout=PIPE)
+    stdout, _stderr = p.communicate()
+    print stdout
     pids = {}
     try:
         port2server = {}