mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
Swap stdout/stderr -- debug messages then go to stderr, and yaml data to stdout
This commit is contained in:
parent
ce6c57841a
commit
0297d61e40
3 changed files with 8 additions and 1 deletions
|
@ -4,6 +4,7 @@ import itertools
|
|||
import os
|
||||
import random
|
||||
import string
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
s3 = bunch.Bunch()
|
||||
|
@ -13,6 +14,10 @@ prefix = ''
|
|||
# For those scripts that use a context, these are pretty univerally needed.
|
||||
context = bunch.Bunch(
|
||||
bucket = None,
|
||||
|
||||
# Save stdout/stderr in case they get fudged with.
|
||||
real_stdout = sys.stdout,
|
||||
real_stderr = sys.stderr,
|
||||
)
|
||||
|
||||
bucket_counter = itertools.count(1)
|
||||
|
|
|
@ -93,7 +93,7 @@ class ResultsLogger(gevent.Greenlet):
|
|||
""" A quick little greenlet to always run and dump results. """
|
||||
def __init__(self):
|
||||
gevent.Greenlet.__init__(self)
|
||||
self.outfile = sys.stderr
|
||||
self.outfile = context.real_stdout
|
||||
|
||||
def _run(self):
|
||||
while True:
|
||||
|
|
|
@ -10,6 +10,7 @@ import random
|
|||
import realistic
|
||||
import time
|
||||
import traceback
|
||||
import sys
|
||||
|
||||
import common
|
||||
from common import context, config
|
||||
|
@ -86,6 +87,7 @@ def _main():
|
|||
|
||||
|
||||
def main():
|
||||
sys.stdout = sys.stderr # Original steam already saved by common
|
||||
common.setup()
|
||||
setup()
|
||||
|
||||
|
|
Loading…
Reference in a new issue