reverted json log changes part2

This commit is contained in:
msiebeneicher 2016-11-04 11:16:08 +01:00
parent 9a1a23fca5
commit 1169cc3a11
4 changed files with 5 additions and 11 deletions

View File

@ -486,11 +486,10 @@ def setup_console_logger(log_level='error', log_format=None, date_format=None):
continue
if handler.stream is sys.stderr:
# There's already a logging handler outputting to sys.stderr or set console handler stream
# There's already a logging handler outputting to sys.stderr
break
else:
handler = StreamHandler(sys.stderr)
handler.setLevel(level)
# Set the default console formatter config

View File

@ -23,7 +23,6 @@ import optparse
import traceback
import yaml
from functools import partial
from io import StringIO
# Import salt libs

View File

@ -618,7 +618,7 @@ class SaltDaemonScriptBase(SaltScriptBase, ShellTestCase):
pass
del sock
elif isinstance(port, str):
joined = self.run_run('manage.joined')
joined = self.run_run('manage.joined', config_dir=self.config_dir)
joined = [x.lstrip('- ') for x in joined]
if port in joined:
check_ports.remove(port)
@ -1952,12 +1952,13 @@ class ShellCase(AdaptedConfigurationTestCaseMixIn, ShellTestCase, ScriptPathMixi
arg_str = '--config-dir {0} {1}'.format(self.get_config_dir(), arg_str)
return self.run_script('salt-call', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, timeout=30)
def run_cloud(self, arg_str, catch_stderr=False, timeout=None):
def run_cloud(self, arg_str, catch_stderr=False, timeout=15):
'''
Execute salt-cloud
'''
arg_str = '-c {0} {1}'.format(self.get_config_dir(), arg_str)
return self.run_script('salt-cloud', arg_str, catch_stderr, timeout)
return self.run_script('salt-cloud', arg_str, catch_stderr,
timeout=timeout)
class ShellCaseCommonTestsMixIn(CheckShellBinaryNameAndVersionMixIn):

View File

@ -5,8 +5,6 @@ unittests for json outputter
# Import Python Libs
from __future__ import absolute_import
from StringIO import StringIO
import sys
# Import Salt Testing Libs
from salttesting import TestCase
@ -16,7 +14,6 @@ ensure_in_syspath('../../')
# Import Salt Libs
from salt.output import json_out as json
from salt.log.setup import set_console_handler_stream
class JsonTestCase(TestCase):
@ -24,8 +21,6 @@ class JsonTestCase(TestCase):
Test cases for salt.output.json_out
'''
def setUp(self):
# reset to default behavior
set_console_handler_stream(sys.stderr)
json.__opts__ = {}
self.data = {'test': 'two', 'example': 'one'}