From 44c3cdef5c31bdcdc8e4961ec9d8ce1647aa8c09 Mon Sep 17 00:00:00 2001 From: "wu.chunyang" Date: Wed, 24 Aug 2022 17:17:42 +0800 Subject: Rename app.wsgi to app_wsgi.py 1. app.wsgi is a python script and should be end with py extension. 2. Generate trove-wsgi script which is needed by kolla to support https and ipv6. 3. Ignore build directory in git 4. update docs Change-Id: Ibbd6ecb8db25aa3a443d3f526f4cf6d418eb26f3 --- trove/cmd/api_wsgi.py | 42 ++++++++++++++++++++++++++++++++++++++++++ trove/cmd/app.wsgi | 41 ----------------------------------------- 2 files changed, 42 insertions(+), 41 deletions(-) create mode 100644 trove/cmd/api_wsgi.py delete mode 100644 trove/cmd/app.wsgi (limited to 'trove') diff --git a/trove/cmd/api_wsgi.py b/trove/cmd/api_wsgi.py new file mode 100644 index 00000000..78eadd5b --- /dev/null +++ b/trove/cmd/api_wsgi.py @@ -0,0 +1,42 @@ +# Copyright 2017 Amrith Kumar. +# All Rights Reserved. +# +# 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. +""" +Used for deploying Trove API through mod-wsgi +""" + +from oslo_log import log as logging +from trove.cmd.common import with_initialize +from trove.common import pastedeploy +from trove.common import profile + +LOG = logging.getLogger('trove.cmd.app') + + +@with_initialize +def wsgimain(CONF): + from trove.common import cfg + from trove.common import notification + from trove.instance import models as inst_models + + notification.DBaaSAPINotification.register_notify_callback( + inst_models.persist_instance_fault) + cfg.set_api_config_defaults() + profile.setup_profiler('api', CONF.host) + conf_file = CONF.find_file(CONF.api_paste_config) + LOG.debug("Trove started on %s", CONF.host) + return pastedeploy.paste_deploy_app(conf_file, 'trove', {}) + + +application = wsgimain() diff --git a/trove/cmd/app.wsgi b/trove/cmd/app.wsgi deleted file mode 100644 index a134539c..00000000 --- a/trove/cmd/app.wsgi +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 Amrith Kumar. -# All Rights Reserved. -# -# 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. -""" -Used for deploying Trove API through mod-wsgi -""" - -from oslo_log import log as logging -from trove.cmd.common import with_initialize -from trove.common import pastedeploy -from trove.common import profile - -LOG = logging.getLogger('trove.cmd.app') - - -@with_initialize -def wsgimain(CONF): - from trove.common import cfg - from trove.common import notification - from trove.instance import models as inst_models - - notification.DBaaSAPINotification.register_notify_callback( - inst_models.persist_instance_fault) - cfg.set_api_config_defaults() - profile.setup_profiler('api', CONF.host) - conf_file = CONF.find_file(CONF.api_paste_config) - LOG.debug("Trove started on %s", CONF.host) - return pastedeploy.paste_deploy_app(conf_file, 'trove', {}) - -application = wsgimain() -- cgit v1.2.1