From 7b0435a706095bfb6c5bac28bd25d1bdd91e1fe1 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 17 Jan 2017 20:01:31 +0100 Subject: [PATCH] Move api-paste file to common code location Change-Id: I33c8055245de5821fd8a605d4ea6bf388a01637e --- aodh/api/__init__.py | 5 ++++- etc/aodh/api_paste.ini => aodh/api/api-paste.ini | 0 aodh/tests/functional/api/__init__.py | 3 --- aodh/tests/functional/gabbi/fixtures.py | 5 ----- devstack/plugin.sh | 1 - 5 files changed, 4 insertions(+), 10 deletions(-) rename etc/aodh/api_paste.ini => aodh/api/api-paste.ini (100%) diff --git a/aodh/api/__init__.py b/aodh/api/__init__.py index 36e0b0dd..c6c41abf 100644 --- a/aodh/api/__init__.py +++ b/aodh/api/__init__.py @@ -12,13 +12,16 @@ # 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 from oslo_config import cfg # Register options for the service OPTS = [ cfg.StrOpt('paste_config', - default="api_paste.ini", + default=os.path.abspath( + os.path.join( + os.path.dirname(__file__), "api-paste.ini")), help="Configuration file for WSGI definition of API."), cfg.StrOpt( 'auth_mode', diff --git a/etc/aodh/api_paste.ini b/aodh/api/api-paste.ini similarity index 100% rename from etc/aodh/api_paste.ini rename to aodh/api/api-paste.ini diff --git a/aodh/tests/functional/api/__init__.py b/aodh/tests/functional/api/__init__.py index 09c8b42a..512d3543 100644 --- a/aodh/tests/functional/api/__init__.py +++ b/aodh/tests/functional/api/__init__.py @@ -44,9 +44,6 @@ class FunctionalTest(db_test_base.TestBase): self.CONF.set_override('policy_file', os.path.abspath('etc/aodh/policy.json'), group='oslo_policy', enforce_type=True) - self.CONF.set_override('paste_config', - os.path.abspath('etc/aodh/api_paste.ini'), - group='api', enforce_type=True) self.CONF.set_override('auth_mode', None, group='api') self.app = webtest.TestApp(app.load_app(self.CONF)) diff --git a/aodh/tests/functional/gabbi/fixtures.py b/aodh/tests/functional/gabbi/fixtures.py index 4aa7ee74..d54282df 100644 --- a/aodh/tests/functional/gabbi/fixtures.py +++ b/aodh/tests/functional/gabbi/fixtures.py @@ -81,11 +81,6 @@ class ConfigFixture(fixture.GabbiFixture): 'aodh/tests/open-policy.json'), group='oslo_policy', enforce_type=True) - conf.set_override( - 'paste_config', - os.path.abspath('etc/aodh/api_paste.ini'), - group='api', - ) conf.set_override('auth_mode', None, group='api') parsed_url = urlparse.urlparse(db_url) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 4a5e2e1b..6933a9e0 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -173,7 +173,6 @@ function configure_aodh { cp $AODH_DIR/etc/aodh/policy.json $AODH_CONF_DIR iniset $AODH_CONF oslo_policy policy_file $AODH_CONF_DIR/policy.json - cp $AODH_DIR/etc/aodh/api_paste.ini $AODH_CONF_DIR cp $AODH_DIR/etc/aodh/aodh-config-generator.conf $AODH_CONF_DIR # The alarm evaluator needs these options to call gnocchi/ceilometer APIs