From 96e13dad754429c38447f180b3c15c6f59f0beb1 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Mon, 7 Jan 2019 12:20:55 +0100 Subject: [PATCH] Replace api-config.conf with monasca-api.conf api-config.conf is the deprecated path for the configuration file. The new path is /etc/monasca/monasca-api.conf . Story: 2004708 Task: 28987 Change-Id: If06d9114529c3ef4520247dfc7c32d3769f07084 --- README.rst | 2 +- config-generator/README.rst | 2 +- config-generator/{api-config.conf => monasca-api.conf} | 2 +- devstack/plugin.sh | 8 ++++---- devstack/settings | 2 +- doc/source/conf.py | 2 +- doc/source/configuration/sample.rst | 6 +++--- docker/Dockerfile | 1 + docker/README.rst | 2 +- docker/{api-config.conf.j2 => monasca-api.conf.j2} | 0 docker/start.sh | 2 +- monasca_api/api/server.py | 2 +- tox.ini | 2 +- 13 files changed, 17 insertions(+), 16 deletions(-) rename config-generator/{api-config.conf => monasca-api.conf} (77%) rename docker/{api-config.conf.j2 => monasca-api.conf.j2} (100%) diff --git a/README.rst b/README.rst index 1c2e4ee50..8e6f11335 100644 --- a/README.rst +++ b/README.rst @@ -34,7 +34,7 @@ kafka server is located: :: /etc/monasca/api-config.ini - /etc/monasca/api-config.conf + /etc/monasca/monasca-api.conf /etc/monasca/api-logging.conf Once the configuration files are modified to match your environment, you diff --git a/config-generator/README.rst b/config-generator/README.rst index 4f99b6fc8..916496812 100644 --- a/config-generator/README.rst +++ b/config-generator/README.rst @@ -14,6 +14,6 @@ After generation you will have sample available in ``etc/api-policy.yaml.sample``. It contains default values for all policies. After you change it to suit your needs you will need to change monasca-api configuration to look for the new policy configuration with specific file name. -Head to ``api-config.conf`` file and then you will need to replace +Head to ``monasca-api.conf`` file and then you will need to replace in ``[oslo_policy]`` section ``policy_file`` to your desired file name (like ``api-policy.yaml``). diff --git a/config-generator/api-config.conf b/config-generator/monasca-api.conf similarity index 77% rename from config-generator/api-config.conf rename to config-generator/monasca-api.conf index 52228f4a6..073bab805 100644 --- a/config-generator/api-config.conf +++ b/config-generator/monasca-api.conf @@ -1,5 +1,5 @@ [DEFAULT] -output_file = etc/api-config.conf.sample +output_file = etc/monasca-api.conf.sample wrap_width = 79 format = ini summarize = True diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 64c2592fb..8d37e5d7c 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -832,10 +832,10 @@ function configure_monasca_api_python { # create configuration files in target locations rm -rf $MONASCA_API_CONF $MONASCA_API_PASTE_INI $MONASCA_API_LOGGING_CONF $MONASCA_API_BIN_DIR/oslo-config-generator \ - --config-file $MONASCA_API_DIR/config-generator/api-config.conf \ - --output-file /tmp/api.conf + --config-file $MONASCA_API_DIR/config-generator/monasca-api.conf \ + --output-file /tmp/monasca-api.conf - install -m 600 /tmp/api.conf $MONASCA_API_CONF && rm -rf /tmp/api.conf + install -m 600 /tmp/monasca-api.conf $MONASCA_API_CONF && rm -rf /tmp/monasca-api.conf install -m 600 $MONASCA_API_DIR/etc/api-logging.conf $MONASCA_API_LOGGING_CONF install -m 600 $MONASCA_API_DIR/etc/api-config.ini $MONASCA_API_PASTE_INI # create configuration files in target locations @@ -957,7 +957,7 @@ function clean_monasca_api_python { echo_summary "Clean Monasca monasca_api_python" - sudo rm -rf /etc/monasca/api-config.conf + sudo rm -rf /etc/monasca/monasca-api.conf sudo rm -rf /etc/monasca/api-logging.conf sudo rm -rf /etc/monasca/api-config.ini sudo rm -rf $MON_API_GATE_CONFIGURATION_DIR diff --git a/devstack/settings b/devstack/settings index b3e489834..de03613ec 100644 --- a/devstack/settings +++ b/devstack/settings @@ -195,7 +195,7 @@ MONASCA_API_SERVICE_PROTOCOL=${MONASCA_API_SERVICE_PROTOCOL:-${SERVICE_PROTOCOL} MONASCA_API_SERVICE_TIMEOUT=${MONASCA_API_SERVICE_TIMEOUT:-${SERVICE_TIMEOUT}} MONASCA_API_CONF_DIR=${MONASCA_API_CONF_DIR:-/etc/monasca} -MONASCA_API_CONF=${MONASCA_API_CONF:-$MONASCA_API_CONF_DIR/api-config.conf} +MONASCA_API_CONF=${MONASCA_API_CONF:-$MONASCA_API_CONF_DIR/monasca-api.conf} MONASCA_API_PASTE_INI=${MONASCA_API_PASTE_INI:-$MONASCA_API_CONF_DIR/api-config.ini} MONASCA_API_LOGGING_CONF=${MONASCA_API_LOGGING_CONF:-$MONASCA_API_CONF_DIR/api-logging.conf} MONASCA_API_LOG_DIR=${MONASCA_API_LOG_DIR:-/var/log/monasca/api} diff --git a/doc/source/conf.py b/doc/source/conf.py index 45c330e44..2667eada5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -53,7 +53,7 @@ author = u'OpenStack Foundation' # sample config config_generator_config_file = [ - ('config-generator/api-config.conf', '_static/api-config') + ('config-generator/monasca-api.conf', '_static/monasca-api') ] # Add any paths that contain templates here, relative to this directory. diff --git a/doc/source/configuration/sample.rst b/doc/source/configuration/sample.rst index 37ad82461..e2c7db344 100644 --- a/doc/source/configuration/sample.rst +++ b/doc/source/configuration/sample.rst @@ -15,10 +15,10 @@ of code in the monasca-api repository. Sample Configuration For Application ------------------------------------ -This sample configuration can also be viewed in `api-config.conf.sample -<../_static/api-config.conf.sample>`_. +This sample configuration can also be viewed in `monasca-api.conf.sample +<../_static/monasca-api.conf.sample>`_. -.. literalinclude:: ../_static/api-config.conf.sample +.. literalinclude:: ../_static/monasca-api.conf.sample .. _sample-configuration-logging: diff --git a/docker/Dockerfile b/docker/Dockerfile index 8a7a142e3..14bf04b93 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -50,6 +50,7 @@ ENV \ # Copy all neccessary files to proper locations. COPY api-* /etc/monasca/ +COPY monasca-api.conf.j2 /etc/monasca/ # Run here all additionals steps your service need post installation. # Stay with only one `RUN` and use `&& \` for next steps to don't create diff --git a/docker/README.rst b/docker/README.rst index d85864999..07717d961 100644 --- a/docker/README.rst +++ b/docker/README.rst @@ -86,7 +86,7 @@ STAY_ALIVE_ON_FAILURE false Provide Configuration templates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* api-config.conf.j2 +* monasca-api.conf.j2 * api-config.ini.j2 * api-logging.conf.j2 diff --git a/docker/api-config.conf.j2 b/docker/monasca-api.conf.j2 similarity index 100% rename from docker/api-config.conf.j2 rename to docker/monasca-api.conf.j2 diff --git a/docker/start.sh b/docker/start.sh index 9c8e25262..5428dfe2a 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -26,7 +26,7 @@ python3 /mysql_check.py # Template all config files before start, it will use env variables. # Read usage examples: https://pypi.org/project/Templer/ echo "Start script: creating config files from templates" -templer -v -f /etc/monasca/api-config.conf.j2 /etc/monasca/api-config.conf +templer -v -f /etc/monasca/monasca-api.conf.j2 /etc/monasca/monasca-api.conf templer -v -f /etc/monasca/api-config.ini.j2 /etc/monasca/api-config.ini templer -v -f /etc/monasca/api-logging.conf.j2 /etc/monasca/api-logging.conf templer -v -f /etc/monasca/api-gunicorn.conf.j2 /etc/monasca/api-gunicorn.conf diff --git a/monasca_api/api/server.py b/monasca_api/api/server.py index f76760437..ae9c5b5c3 100644 --- a/monasca_api/api/server.py +++ b/monasca_api/api/server.py @@ -100,7 +100,7 @@ def launch(conf): def get_wsgi_app(config_base_path=None, **kwargs): # allow to override names of the configuration files - config_file = kwargs.get('config_file', 'api-config.conf') + config_file = kwargs.get('config_file', 'monasca-api.conf') paste_file = kwargs.get('paste_file', 'api-config.ini') if config_base_path is None: diff --git a/tox.ini b/tox.ini index e832a9372..7724b5c36 100644 --- a/tox.ini +++ b/tox.ini @@ -128,7 +128,7 @@ commands = [testenv:genconfig] basepython = python3 description = Generates sample configuration file for monasca-api -commands = oslo-config-generator --config-file=config-generator/api-config.conf +commands = oslo-config-generator --config-file=config-generator/monasca-api.conf [testenv:genpolicy] basepython = python3