summaryrefslogtreecommitdiffstats
path: root/bin/nova-api
diff options
context:
space:
mode:
authorBrian Lamar <brian.lamar@rackspace.com>2011-06-18 23:10:41 -0400
committerBrian Lamar <brian.lamar@rackspace.com>2011-06-18 23:10:41 -0400
commit843644aed6477b4411ec3f07d1a5271df41c9798 (patch)
treecb0d1cfaf7a0542004416f536a12583d2b710d34 /bin/nova-api
parentcf751516b6d7381fca5f0678c07baaa0f7fccece (diff)
General cleanup and refactor of a lot of the API/WSGI service code.
Diffstat (limited to 'bin/nova-api')
-rwxr-xr-xbin/nova-api18
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/nova-api b/bin/nova-api
index a1088c23d..6db68be9c 100755
--- a/bin/nova-api
+++ b/bin/nova-api
@@ -24,6 +24,8 @@ import gettext
import os
import sys
+import eventlet.pool
+
# If ../nova/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
@@ -46,6 +48,13 @@ LOG = logging.getLogger('nova.api')
FLAGS = flags.FLAGS
+
+def launch(service_name):
+ _service = service.WSGIService(service_name)
+ _service.start()
+ _service.wait()
+
+
if __name__ == '__main__':
utils.default_flagfile()
FLAGS(sys.argv)
@@ -57,5 +66,10 @@ if __name__ == '__main__':
flag_get = FLAGS.get(flag, None)
LOG.debug("%(flag)s : %(flag_get)s" % locals())
- service = service.serve_wsgi(service.ApiService)
- service.wait()
+
+ pool = eventlet.pool.Pool()
+ pool.execute(launch, "ec2")
+ pool.execute(launch, "osapi")
+ pool.wait_all()
+
+ print >>sys.stderr, "Exiting..."