From c21f8b56ed5def59dcefe5440e86b90653ada687 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Fri, 4 May 2018 10:03:53 +0200 Subject: [PATCH 1/6] Update all the entry points (services, scripts) to use /etc/st2/st2.conf as a default config file value. This way users don't always need to explicitly pass --config-file /etc/st2/st2.conf argument to all the scripts on production installation. --- st2actions/st2actions/notifier/config.py | 4 +++- st2actions/st2actions/resultstracker/config.py | 4 +++- st2api/st2api/config.py | 4 +++- st2auth/st2auth/config.py | 4 +++- st2common/st2common/config.py | 4 +++- st2common/st2common/constants/system.py | 2 ++ st2exporter/st2exporter/config.py | 4 +++- st2reactor/st2reactor/garbage_collector/config.py | 4 +++- st2reactor/st2reactor/rules/config.py | 4 +++- st2reactor/st2reactor/sensor/config.py | 4 +++- st2stream/st2stream/config.py | 4 +++- 11 files changed, 32 insertions(+), 10 deletions(-) diff --git a/st2actions/st2actions/notifier/config.py b/st2actions/st2actions/notifier/config.py index b630ef07ac..f8590ff4b3 100644 --- a/st2actions/st2actions/notifier/config.py +++ b/st2actions/st2actions/notifier/config.py @@ -18,13 +18,15 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE common_config.register_opts() CONF = cfg.CONF def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(): diff --git a/st2actions/st2actions/resultstracker/config.py b/st2actions/st2actions/resultstracker/config.py index 2be78020ad..8325374395 100644 --- a/st2actions/st2actions/resultstracker/config.py +++ b/st2actions/st2actions/resultstracker/config.py @@ -18,13 +18,15 @@ from st2common import config as common_config from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE common_config.register_opts() CONF = cfg.CONF def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(): diff --git a/st2api/st2api/config.py b/st2api/st2api/config.py index 91e0c3c673..4763f32734 100644 --- a/st2api/st2api/config.py +++ b/st2api/st2api/config.py @@ -23,13 +23,15 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE CONF = cfg.CONF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(): diff --git a/st2auth/st2auth/config.py b/st2auth/st2auth/config.py index 8e73560109..4cad34cd65 100644 --- a/st2auth/st2auth/config.py +++ b/st2auth/st2auth/config.py @@ -17,6 +17,7 @@ from st2common import config as st2cfg from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE from st2common.constants.auth import DEFAULT_MODE from st2common.constants.auth import DEFAULT_BACKEND from st2common.constants.auth import VALID_MODES @@ -24,7 +25,8 @@ def parse_args(args=None): - cfg.CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(): diff --git a/st2common/st2common/config.py b/st2common/st2common/config.py index 512e4f969c..31740af2ea 100644 --- a/st2common/st2common/config.py +++ b/st2common/st2common/config.py @@ -22,6 +22,7 @@ from distutils.spawn import find_executable from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE from st2common.constants.runners import PYTHON_RUNNER_DEFAULT_LOG_LEVEL @@ -393,4 +394,5 @@ def register_opts(ignore_errors=False): def parse_args(args=None): register_opts() - cfg.CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) diff --git a/st2common/st2common/constants/system.py b/st2common/st2common/constants/system.py index 4560d07108..0d915164ce 100644 --- a/st2common/st2common/constants/system.py +++ b/st2common/st2common/constants/system.py @@ -18,12 +18,14 @@ __all__ = [ 'VERSION_STRING', + 'DEFAULT_CONFIG_FILE' 'API_URL_ENV_VARIABLE_NAME', 'AUTH_TOKEN_ENV_VARIABLE_NAME', ] VERSION_STRING = 'StackStorm v%s' % (__version__) +DEFAULT_CONFIG_FILE = '/etc/st2/st2.conf' API_URL_ENV_VARIABLE_NAME = 'ST2_API_URL' AUTH_TOKEN_ENV_VARIABLE_NAME = 'ST2_AUTH_TOKEN' diff --git a/st2exporter/st2exporter/config.py b/st2exporter/st2exporter/config.py index ed03a15dff..ed1135e24b 100644 --- a/st2exporter/st2exporter/config.py +++ b/st2exporter/st2exporter/config.py @@ -21,13 +21,15 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE common_config.register_opts() CONF = cfg.CONF def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def get_logging_config_path(): diff --git a/st2reactor/st2reactor/garbage_collector/config.py b/st2reactor/st2reactor/garbage_collector/config.py index 6d21d97af2..4dac8ab982 100644 --- a/st2reactor/st2reactor/garbage_collector/config.py +++ b/st2reactor/st2reactor/garbage_collector/config.py @@ -18,6 +18,7 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE from st2common.constants.garbage_collection import DEFAULT_COLLECTION_INTERVAL from st2common.constants.garbage_collection import DEFAULT_SLEEP_DELAY common_config.register_opts() @@ -26,7 +27,8 @@ def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(): diff --git a/st2reactor/st2reactor/rules/config.py b/st2reactor/st2reactor/rules/config.py index 1e40a1eb33..ed0c624647 100644 --- a/st2reactor/st2reactor/rules/config.py +++ b/st2reactor/st2reactor/rules/config.py @@ -18,13 +18,15 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE common_config.register_opts() CONF = cfg.CONF def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(): diff --git a/st2reactor/st2reactor/sensor/config.py b/st2reactor/st2reactor/sensor/config.py index 1bc0abd652..effcce02a4 100644 --- a/st2reactor/st2reactor/sensor/config.py +++ b/st2reactor/st2reactor/sensor/config.py @@ -19,12 +19,14 @@ from st2common import config as st2cfg from st2common.constants.sensors import DEFAULT_PARTITION_LOADER from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE CONF = cfg.CONF def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(ignore_errors=False): diff --git a/st2stream/st2stream/config.py b/st2stream/st2stream/config.py index c8c18dd133..6c34743192 100644 --- a/st2stream/st2stream/config.py +++ b/st2stream/st2stream/config.py @@ -23,13 +23,15 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING +from st2common.constants.system import DEFAULT_CONFIG_FILE CONF = cfg.CONF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) def parse_args(args=None): - CONF(args=args, version=VERSION_STRING) + cfg.CONF(args=args, version=VERSION_STRING, + default_config_files=[DEFAULT_CONFIG_FILE]) def register_opts(): From 5a13d7b475819e377ed6b1e81ec25f97b897abfa Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Fri, 4 May 2018 10:19:34 +0200 Subject: [PATCH 2/6] Add changelog entry. --- CHANGELOG.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3324f95d4e..c388e6d819 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,19 @@ in development Changed ~~~~~~~ +* Update all the service and script entry points to use ``/etc/st2/st2.conf`` as a default value + for the config file location. + + This way users don't need to explicitly provide ``--config-file`` CLI argument when running + various scripts (e.g. ``st2-track-result``, ``st2-apply-rbac-definitions``, etc.) and when they + just want to use a default config file. (improvement) #4111 + +2.7.1 - April 20, 2018 +---------------------- + +Changed +~~~~~~~ + * When creating a pack environment during the pack installation, we now pass ``--no-download`` flag to the ``virtualenv`` binary. This way version of pip, wheel and distutils which is enforced by virtualenv is used instead of downloading the latest stable versions from PyPi. From a9b74e3484a1939e79c81d11cdbd830a44bba0e9 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Fri, 4 May 2018 12:44:51 +0200 Subject: [PATCH 3/6] For consistency with wsgi entry point module try to first infer default config path using ST2_CONFIG_PATH environment variable and if that is not set / available, use /etc/st2/st2.conf. --- st2common/st2common/constants/system.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/st2common/st2common/constants/system.py b/st2common/st2common/constants/system.py index 0d915164ce..bf3e525e39 100644 --- a/st2common/st2common/constants/system.py +++ b/st2common/st2common/constants/system.py @@ -14,18 +14,21 @@ # limitations under the License. from __future__ import absolute_import + +import os + from st2common import __version__ __all__ = [ 'VERSION_STRING', - 'DEFAULT_CONFIG_FILE' + 'DEFAULT_CONFIG_FILE', 'API_URL_ENV_VARIABLE_NAME', 'AUTH_TOKEN_ENV_VARIABLE_NAME', ] VERSION_STRING = 'StackStorm v%s' % (__version__) -DEFAULT_CONFIG_FILE = '/etc/st2/st2.conf' +DEFAULT_CONFIG_FILE = os.environ.get('ST2_CONFIG_PATH', '/etc/st2/st2.conf') API_URL_ENV_VARIABLE_NAME = 'ST2_API_URL' AUTH_TOKEN_ENV_VARIABLE_NAME = 'ST2_AUTH_TOKEN' From e815732f310f210fd5fd8edac3fb559b360865ab Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Fri, 4 May 2018 12:47:47 +0200 Subject: [PATCH 4/6] Use dev config for generate api config step. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 948e23428e..08251003b4 100644 --- a/Makefile +++ b/Makefile @@ -133,14 +133,14 @@ generate-api-spec: requirements .generate-api-spec echo "# Edit st2common/st2common/openapi.yaml.j2 and then run" >> st2common/st2common/openapi.yaml echo "# make .generate-api-spec" >> st2common/st2common/openapi.yaml echo "# to generate the final spec file" >> st2common/st2common/openapi.yaml - . virtualenv/bin/activate; st2common/bin/st2-generate-api-spec >> st2common/st2common/openapi.yaml + . virtualenv/bin/activate; st2common/bin/st2-generate-api-spec --config-file conf/st2.dev.conf >> st2common/st2common/openapi.yaml .PHONY: circle-lint-api-spec circle-lint-api-spec: @echo @echo "================== Lint API spec ====================" @echo - . $(VIRTUALENV_DIR)/bin/activate; st2common/bin/st2-validate-api-spec || echo "Open API spec lint failed." + . $(VIRTUALENV_DIR)/bin/activate; st2common/bin/st2-validate-api-spec --config-file conf/st2.dev.conf || echo "Open API spec lint failed." .PHONY: flake8 flake8: requirements .flake8 From 9e65e8110770d959a9d08266b8eab43d159e30db Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Fri, 4 May 2018 15:42:38 +0200 Subject: [PATCH 5/6] Add a test case for it. --- st2common/tests/unit/test_service_setup.py | 43 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/st2common/tests/unit/test_service_setup.py b/st2common/tests/unit/test_service_setup.py index 924143d9cc..71b34eb83c 100644 --- a/st2common/tests/unit/test_service_setup.py +++ b/st2common/tests/unit/test_service_setup.py @@ -20,9 +20,13 @@ import six import mock +from oslo_config import cfg +from oslo_config.cfg import ConfigFilesNotFoundError + from st2common import service_setup from st2common.transport.bootstrap_utils import register_exchanges from st2common.transport.bootstrap_utils import QUEUES +from st2common import config as st2common_config from st2tests.base import CleanFilesTestCase from st2tests import config @@ -57,11 +61,15 @@ datefmt= """.strip() +MOCK_DEFAULT_CONFIG_FILE_PATH = '/etc/st2/st2.conf-test-patched' + + +def mock_get_logging_config_path(): + return '' + class ServiceSetupTestCase(CleanFilesTestCase): def test_no_logging_config_found(self): - def mock_get_logging_config_path(): - return '' config.get_logging_config_path = mock_get_logging_config_path @@ -112,3 +120,34 @@ def test_register_exchanges_predeclare_queues(self, mock_declare): register_exchanges() self.assertEqual(mock_declare.call_count, len(QUEUES)) + + @mock.patch('st2common.constants.system.DEFAULT_CONFIG_FILE', MOCK_DEFAULT_CONFIG_FILE_PATH) + @mock.patch('st2common.config.DEFAULT_CONFIG_FILE', MOCK_DEFAULT_CONFIG_FILE_PATH) + def test_service_setup_default_st2_conf_config_is_used(self): + st2common_config.get_logging_config_path = mock_get_logging_config_path + cfg.CONF.reset() + + # 1. DEFAULT_CONFIG_FILE config path should be used by default (/etc/st2/st2.conf) + expected_msg = 'Failed to find some config files: %s' % (MOCK_DEFAULT_CONFIG_FILE_PATH) + self.assertRaisesRegexp(ConfigFilesNotFoundError, expected_msg, service_setup.setup, + service='api', + config=st2common_config, + config_args=['--debug'], + setup_db=False, register_mq_exchanges=False, + register_signal_handlers=False, + register_internal_trigger_types=False, + run_migrations=False) + + cfg.CONF.reset() + + # 2. --config-file should still override default config file path option + config_file_path = '/etc/st2/config.override.test' + expected_msg = 'Failed to find some config files: %s' % (config_file_path) + self.assertRaisesRegexp(ConfigFilesNotFoundError, expected_msg, service_setup.setup, + service='api', + config=st2common_config, + config_args=['--config-file', config_file_path], + setup_db=False, register_mq_exchanges=False, + register_signal_handlers=False, + register_internal_trigger_types=False, + run_migrations=False) From a140900a8763fce780b91802dab637ccddc154ef Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Fri, 4 May 2018 15:48:49 +0200 Subject: [PATCH 6/6] Use consistent variable name. --- st2actions/st2actions/notifier/config.py | 4 ++-- st2actions/st2actions/resultstracker/config.py | 4 ++-- st2api/st2api/config.py | 4 ++-- st2auth/st2auth/config.py | 4 ++-- st2common/st2common/config.py | 4 ++-- st2common/st2common/constants/system.py | 4 ++-- st2common/tests/unit/test_service_setup.py | 7 ++++--- st2exporter/st2exporter/config.py | 4 ++-- st2reactor/st2reactor/garbage_collector/config.py | 4 ++-- st2reactor/st2reactor/rules/config.py | 4 ++-- st2reactor/st2reactor/sensor/config.py | 4 ++-- st2stream/st2stream/config.py | 4 ++-- 12 files changed, 26 insertions(+), 25 deletions(-) diff --git a/st2actions/st2actions/notifier/config.py b/st2actions/st2actions/notifier/config.py index f8590ff4b3..3687e7a421 100644 --- a/st2actions/st2actions/notifier/config.py +++ b/st2actions/st2actions/notifier/config.py @@ -18,7 +18,7 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH common_config.register_opts() CONF = cfg.CONF @@ -26,7 +26,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts(): diff --git a/st2actions/st2actions/resultstracker/config.py b/st2actions/st2actions/resultstracker/config.py index 8325374395..b639e34302 100644 --- a/st2actions/st2actions/resultstracker/config.py +++ b/st2actions/st2actions/resultstracker/config.py @@ -18,7 +18,7 @@ from st2common import config as common_config from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH common_config.register_opts() CONF = cfg.CONF @@ -26,7 +26,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts(): diff --git a/st2api/st2api/config.py b/st2api/st2api/config.py index 4763f32734..e94c2b7df4 100644 --- a/st2api/st2api/config.py +++ b/st2api/st2api/config.py @@ -23,7 +23,7 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH CONF = cfg.CONF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -31,7 +31,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts(): diff --git a/st2auth/st2auth/config.py b/st2auth/st2auth/config.py index 4cad34cd65..4e00083a90 100644 --- a/st2auth/st2auth/config.py +++ b/st2auth/st2auth/config.py @@ -17,7 +17,7 @@ from st2common import config as st2cfg from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH from st2common.constants.auth import DEFAULT_MODE from st2common.constants.auth import DEFAULT_BACKEND from st2common.constants.auth import VALID_MODES @@ -26,7 +26,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts(): diff --git a/st2common/st2common/config.py b/st2common/st2common/config.py index 31740af2ea..99ab00f764 100644 --- a/st2common/st2common/config.py +++ b/st2common/st2common/config.py @@ -22,7 +22,7 @@ from distutils.spawn import find_executable from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH from st2common.constants.runners import PYTHON_RUNNER_DEFAULT_LOG_LEVEL @@ -395,4 +395,4 @@ def register_opts(ignore_errors=False): def parse_args(args=None): register_opts() cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) diff --git a/st2common/st2common/constants/system.py b/st2common/st2common/constants/system.py index bf3e525e39..51b357c324 100644 --- a/st2common/st2common/constants/system.py +++ b/st2common/st2common/constants/system.py @@ -21,14 +21,14 @@ __all__ = [ 'VERSION_STRING', - 'DEFAULT_CONFIG_FILE', + 'DEFAULT_CONFIG_FILE_PATH', 'API_URL_ENV_VARIABLE_NAME', 'AUTH_TOKEN_ENV_VARIABLE_NAME', ] VERSION_STRING = 'StackStorm v%s' % (__version__) -DEFAULT_CONFIG_FILE = os.environ.get('ST2_CONFIG_PATH', '/etc/st2/st2.conf') +DEFAULT_CONFIG_FILE_PATH = os.environ.get('ST2_CONFIG_PATH', '/etc/st2/st2.conf') API_URL_ENV_VARIABLE_NAME = 'ST2_API_URL' AUTH_TOKEN_ENV_VARIABLE_NAME = 'ST2_AUTH_TOKEN' diff --git a/st2common/tests/unit/test_service_setup.py b/st2common/tests/unit/test_service_setup.py index 71b34eb83c..f76b0c01ac 100644 --- a/st2common/tests/unit/test_service_setup.py +++ b/st2common/tests/unit/test_service_setup.py @@ -121,13 +121,14 @@ def test_register_exchanges_predeclare_queues(self, mock_declare): register_exchanges() self.assertEqual(mock_declare.call_count, len(QUEUES)) - @mock.patch('st2common.constants.system.DEFAULT_CONFIG_FILE', MOCK_DEFAULT_CONFIG_FILE_PATH) - @mock.patch('st2common.config.DEFAULT_CONFIG_FILE', MOCK_DEFAULT_CONFIG_FILE_PATH) + @mock.patch('st2common.constants.system.DEFAULT_CONFIG_FILE_PATH', + MOCK_DEFAULT_CONFIG_FILE_PATH) + @mock.patch('st2common.config.DEFAULT_CONFIG_FILE_PATH', MOCK_DEFAULT_CONFIG_FILE_PATH) def test_service_setup_default_st2_conf_config_is_used(self): st2common_config.get_logging_config_path = mock_get_logging_config_path cfg.CONF.reset() - # 1. DEFAULT_CONFIG_FILE config path should be used by default (/etc/st2/st2.conf) + # 1. DEFAULT_CONFIG_FILE_PATH config path should be used by default (/etc/st2/st2.conf) expected_msg = 'Failed to find some config files: %s' % (MOCK_DEFAULT_CONFIG_FILE_PATH) self.assertRaisesRegexp(ConfigFilesNotFoundError, expected_msg, service_setup.setup, service='api', diff --git a/st2exporter/st2exporter/config.py b/st2exporter/st2exporter/config.py index ed1135e24b..d493dcabef 100644 --- a/st2exporter/st2exporter/config.py +++ b/st2exporter/st2exporter/config.py @@ -21,7 +21,7 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH common_config.register_opts() CONF = cfg.CONF @@ -29,7 +29,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def get_logging_config_path(): diff --git a/st2reactor/st2reactor/garbage_collector/config.py b/st2reactor/st2reactor/garbage_collector/config.py index 4dac8ab982..745ed61642 100644 --- a/st2reactor/st2reactor/garbage_collector/config.py +++ b/st2reactor/st2reactor/garbage_collector/config.py @@ -18,7 +18,7 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH from st2common.constants.garbage_collection import DEFAULT_COLLECTION_INTERVAL from st2common.constants.garbage_collection import DEFAULT_SLEEP_DELAY common_config.register_opts() @@ -28,7 +28,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts(): diff --git a/st2reactor/st2reactor/rules/config.py b/st2reactor/st2reactor/rules/config.py index ed0c624647..9b6daaf844 100644 --- a/st2reactor/st2reactor/rules/config.py +++ b/st2reactor/st2reactor/rules/config.py @@ -18,7 +18,7 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH common_config.register_opts() CONF = cfg.CONF @@ -26,7 +26,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts(): diff --git a/st2reactor/st2reactor/sensor/config.py b/st2reactor/st2reactor/sensor/config.py index effcce02a4..bbbdfec397 100644 --- a/st2reactor/st2reactor/sensor/config.py +++ b/st2reactor/st2reactor/sensor/config.py @@ -19,14 +19,14 @@ from st2common import config as st2cfg from st2common.constants.sensors import DEFAULT_PARTITION_LOADER from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH CONF = cfg.CONF def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts(ignore_errors=False): diff --git a/st2stream/st2stream/config.py b/st2stream/st2stream/config.py index 6c34743192..c23cb4edf8 100644 --- a/st2stream/st2stream/config.py +++ b/st2stream/st2stream/config.py @@ -23,7 +23,7 @@ import st2common.config as common_config from st2common.constants.system import VERSION_STRING -from st2common.constants.system import DEFAULT_CONFIG_FILE +from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH CONF = cfg.CONF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -31,7 +31,7 @@ def parse_args(args=None): cfg.CONF(args=args, version=VERSION_STRING, - default_config_files=[DEFAULT_CONFIG_FILE]) + default_config_files=[DEFAULT_CONFIG_FILE_PATH]) def register_opts():