Repository: trafficserver-qa Updated Branches: refs/heads/master c04800889 -> 5a74e467c
Fix log level setting Other misc cleanup. Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/5a74e467 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/5a74e467 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/5a74e467 Branch: refs/heads/master Commit: 5a74e467c48e6570683990422ed2866d1ec73522 Parents: c048008 Author: Thomas Jackson <[email protected]> Authored: Mon Apr 6 14:27:49 2015 -0700 Committer: Thomas Jackson <[email protected]> Committed: Mon Apr 6 14:27:49 2015 -0700 ---------------------------------------------------------------------- tsqa/environment.py | 4 ++-- tsqa/log.py | 9 ++++++++- tsqa/test_cases.py | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/5a74e467/tsqa/environment.py ---------------------------------------------------------------------- diff --git a/tsqa/environment.py b/tsqa/environment.py index d170814..71895fd 100644 --- a/tsqa/environment.py +++ b/tsqa/environment.py @@ -196,7 +196,7 @@ class EnvironmentFactory(object): return ret -class Layout: +class Layout(object): """ The Layout class is responsible for the set of installation paths within a prefixed Traffic Server instance. @@ -252,7 +252,7 @@ class Layout: return layout -class Environment: +class Environment(object): ''' This is the core of tsqa. An environment is a directory (effectively a root dir) with code and configs installed into it. This object is also responsible for http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/5a74e467/tsqa/log.py ---------------------------------------------------------------------- diff --git a/tsqa/log.py b/tsqa/log.py index f7d247c..600029a 100644 --- a/tsqa/log.py +++ b/tsqa/log.py @@ -17,7 +17,14 @@ import logging import os -logging.root.setLevel(os.environ.get('TSQA_LOG_LEVEL', logging.INFO)) +if 'TSQA_LOG_LEVEL' in os.environ: + lvl_str = os.environ['TSQA_LOG_LEVEL'] + if not lvl_str.isupper(): + raise Exception('Log levels must be all capitals') + + logging.root.setLevel(getattr(logging, lvl_str)) +else: + logging.root.setLevel(logging.INFO) handler = logging.StreamHandler() handler.setLevel(os.environ.get('TSQA_LOG_LEVEL', logging.INFO)) handler.setFormatter(logging.Formatter("%(levelname)s %(asctime)-15s - %(message)s")) http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/5a74e467/tsqa/test_cases.py ---------------------------------------------------------------------- diff --git a/tsqa/test_cases.py b/tsqa/test_cases.py index 14d628f..ab68fcd 100644 --- a/tsqa/test_cases.py +++ b/tsqa/test_cases.py @@ -76,7 +76,7 @@ class EnvironmentCase(unittest.TestCase): # call env setup, so people can change configs etc cls.setUpEnv(cls.environment) - for _, cfg in cls.configs.iteritems(): + for cfg in cls.configs.itervalues(): cfg.write() # start ATS
