summaryrefslogtreecommitdiff
path: root/ironic/api
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-01-08 18:09:32 +0000
committerGerrit Code Review <review@openstack.org>2018-01-08 18:09:33 +0000
commit01cf26019e96b3a340db2692e91d27b90737d0e7 (patch)
tree1fc63cffb4e31716fcf2cc383fb97c1497e8f1d2 /ironic/api
parent2c13e4157d7821161f6e4c5e76d8575cc29247e7 (diff)
parent61b81d0c735f7d4ccbde4f4c818e4a7320ea544a (diff)
downloadironic-01cf26019e96b3a340db2692e91d27b90737d0e7.tar.gz
Merge "Add uWSGI support"
Diffstat (limited to 'ironic/api')
-rw-r--r--ironic/api/app.wsgi22
-rw-r--r--ironic/api/wsgi.py41
2 files changed, 43 insertions, 20 deletions
diff --git a/ironic/api/app.wsgi b/ironic/api/app.wsgi
index 5c26248ec..d9e5c053b 100644
--- a/ironic/api/app.wsgi
+++ b/ironic/api/app.wsgi
@@ -16,24 +16,6 @@
Use this file for deploying the API service under Apache2 mod_wsgi.
"""
-import sys
+from ironic.api import wsgi
-from oslo_config import cfg
-import oslo_i18n as i18n
-from oslo_log import log
-
-from ironic.api import app
-from ironic.common import service
-
-
-CONF = cfg.CONF
-
-i18n.install('ironic')
-
-service.prepare_service(sys.argv)
-
-LOG = log.getLogger(__name__)
-LOG.debug("Configuration:")
-CONF.log_opt_values(LOG, log.DEBUG)
-
-application = app.VersionSelectorApplication()
+application = wsgi.initialize_wsgi_app(show_deprecated=True)
diff --git a/ironic/api/wsgi.py b/ironic/api/wsgi.py
new file mode 100644
index 000000000..7daf19980
--- /dev/null
+++ b/ironic/api/wsgi.py
@@ -0,0 +1,41 @@
+# 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.
+"""WSGI script for Ironic API, installed by pbr."""
+
+import sys
+
+from oslo_config import cfg
+import oslo_i18n as i18n
+from oslo_log import log
+
+from ironic.api import app
+from ironic.common import service
+
+
+CONF = cfg.CONF
+LOG = log.getLogger(__name__)
+
+
+def initialize_wsgi_app(show_deprecated=False):
+ i18n.install('ironic')
+
+ service.prepare_service(sys.argv)
+
+ LOG.debug("Configuration:")
+ CONF.log_opt_values(LOG, log.DEBUG)
+
+ if show_deprecated:
+ LOG.warning("Using ironic/api/app.wsgi is deprecated and it will "
+ "be removed in Rocky release. Please use automatically "
+ "generated ironic-api-wsgi instead.")
+
+ return app.VersionSelectorApplication()