diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b9fc5ae46e..f1897ca438 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,7 +14,7 @@ Added working on StackStorm, improve our security posture, and improve CI reliability thanks in part to pants' use of PEX lockfiles. This is not a user-facing addition. #5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850 - #5846 #5853 #5848 #5847 + #5846 #5853 #5848 #5847 #5858 Contributed by @cognifloyd * Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805 diff --git a/st2common/st2common/conf/BUILD b/st2common/st2common/conf/BUILD index 3b89b94788..f21b91df2b 100644 --- a/st2common/st2common/conf/BUILD +++ b/st2common/st2common/conf/BUILD @@ -3,3 +3,7 @@ resource( name="base.logging.conf", source="base.logging.conf", ) + +python_sources( + dependencies=[":base.logging.conf"], +) diff --git a/st2common/st2common/conf/__init__.py b/st2common/st2common/conf/__init__.py new file mode 100644 index 0000000000..02dee96c31 --- /dev/null +++ b/st2common/st2common/conf/__init__.py @@ -0,0 +1,18 @@ +# Copyright 2023 The StackStorm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +CONF_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) +BASE_LOGGING_CONF_PATH = os.path.join(CONF_DIR, "base.logging.conf") diff --git a/st2common/st2common/constants/BUILD b/st2common/st2common/constants/BUILD index f0ac5efd12..db46e8d6c9 100644 --- a/st2common/st2common/constants/BUILD +++ b/st2common/st2common/constants/BUILD @@ -1,5 +1 @@ -python_sources( - dependencies=[ - "st2common/st2common/conf:base.logging.conf", - ] -) +python_sources() diff --git a/st2common/st2common/constants/logging.py b/st2common/st2common/constants/logging.py index 0985a03947..1db8f721a5 100644 --- a/st2common/st2common/constants/logging.py +++ b/st2common/st2common/constants/logging.py @@ -14,11 +14,6 @@ # limitations under the License. from __future__ import absolute_import -import os +from st2common.conf import BASE_LOGGING_CONF_PATH as DEFAULT_LOGGING_CONF_PATH __all__ = ["DEFAULT_LOGGING_CONF_PATH"] - -BASE_PATH = os.path.dirname(os.path.abspath(__file__)) - -DEFAULT_LOGGING_CONF_PATH = os.path.join(BASE_PATH, "../conf/base.logging.conf") -DEFAULT_LOGGING_CONF_PATH = os.path.abspath(DEFAULT_LOGGING_CONF_PATH)