Browse Source

Merge "Expose neutron api application as a wsgi script"

tags/11.0.0.0b2
Jenkins 2 years ago
parent
commit
916bc96ee2

+ 12
- 1
neutron/server/__init__.py View File

@@ -22,9 +22,10 @@ from oslo_config import cfg
22 22
 
23 23
 from neutron._i18n import _
24 24
 from neutron.common import config
25
+from neutron.common import profiler
25 26
 
26 27
 
27
-def boot_server(server_func):
28
+def _init_configuration():
28 29
     # the configuration will be read into the cfg.CONF global data structure
29 30
     config.init(sys.argv[1:])
30 31
     config.setup_logging()
@@ -33,9 +34,19 @@ def boot_server(server_func):
33 34
         sys.exit(_("ERROR: Unable to find configuration file via the default"
34 35
                    " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and"
35 36
                    " the '--config-file' option!"))
37
+
38
+
39
+def boot_server(server_func):
40
+    _init_configuration()
36 41
     try:
37 42
         server_func()
38 43
     except KeyboardInterrupt:
39 44
         pass
40 45
     except RuntimeError as e:
41 46
         sys.exit(_("ERROR: %s") % e)
47
+
48
+
49
+def get_application():
50
+    _init_configuration()
51
+    profiler.setup('neutron-server', cfg.CONF.host)
52
+    return config.load_paste_app('neutron')

+ 7
- 0
releasenotes/notes/add-wsgi-script-support-e611fa5b5c2043a5.yaml View File

@@ -0,0 +1,7 @@
1
+---
2
+prelude: >
3
+    This release adds support for running Neutron API component with a ``mod_wsgi``
4
+    compatible web server.
5
+features:
6
+  - Neutron API can now be managed by a ``mod_wsgi`` compatible web server (e.g.
7
+    ``apache2`` (``httpd``), ``nginx``, etc.)

+ 2
- 0
setup.cfg View File

@@ -41,6 +41,8 @@ scripts =
41 41
     bin/neutron-rootwrap-xen-dom0
42 42
 
43 43
 [entry_points]
44
+wsgi_scripts =
45
+    neutron-api = neutron.server:get_application
44 46
 console_scripts =
45 47
     neutron-db-manage = neutron.db.migration.cli:main
46 48
     neutron-debug = neutron.debug.shell:main

Loading…
Cancel
Save