Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-48-aria-cli e04ba1fb1 -> 4275d2150
fixed operation logging issues in tests Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/4275d215 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/4275d215 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/4275d215 Branch: refs/heads/ARIA-48-aria-cli Commit: 4275d2150e32968d45d1419ff0236f8c203f0fe7 Parents: e04ba1f Author: Ran Ziv <[email protected]> Authored: Thu Apr 6 16:13:09 2017 +0300 Committer: Ran Ziv <[email protected]> Committed: Thu Apr 6 16:13:09 2017 +0300 ---------------------------------------------------------------------- aria/orchestrator/context/common.py | 5 ++++- tests/conftest.py | 9 ++------- 2 files changed, 6 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4275d215/aria/orchestrator/context/common.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index 4cb7bce..61ef9c0 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -32,6 +32,9 @@ from aria.storage import exceptions from ...utils.uuid import generate_uuid +TASK_LOGGER_NAME = 'aria.executions.task' + + class BaseContext(object): """ Base context object for workflow and operation @@ -69,7 +72,7 @@ class BaseContext(object): def _register_logger(self, level=None, task_id=None): self.logger = self.PrefixedLogger( - logging.getLogger('aria.executions.task'), self.logging_id, task_id=task_id) + logging.getLogger(TASK_LOGGER_NAME), self.logging_id, task_id=task_id) self.logger.setLevel(level or logging.DEBUG) if not self.logger.handlers: self.logger.addHandler(aria_logger.create_console_log_handler()) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4275d215/tests/conftest.py ---------------------------------------------------------------------- diff --git a/tests/conftest.py b/tests/conftest.py index c501eeb..e604eb8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,6 +18,7 @@ import logging import pytest import aria +from aria.orchestrator.context import common @pytest.fixture(scope='session', autouse=True) @@ -37,11 +38,5 @@ def logging_handler_cleanup(request): :return: """ def clear_logging_handlers(): - logged_ctx_names = [ - aria.orchestrator.context.workflow.WorkflowContext.__name__, - aria.orchestrator.context.operation.NodeOperationContext.__name__, - aria.orchestrator.context.operation.RelationshipOperationContext.__name__ - ] - for logger_name in logged_ctx_names: - logging.getLogger(logger_name).handlers = [] + logging.getLogger(common.TASK_LOGGER_NAME).handlers = [] request.addfinalizer(clear_logging_handlers)
