summaryrefslogtreecommitdiffstats
path: root/bin/nova-api
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-07-21 11:42:13 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-07-21 11:42:13 -0400
commitad9d6f0feb0eecc59796d3dc4700d6241b693703 (patch)
treee95cde60593788f0a0940707b425ad9624601300 /bin/nova-api
parent0ce8407b0c17d0d28aaf41d1b3b5d4b1a9de99d4 (diff)
parent94a22ae4575a60e6b8096c1baeda8828feb30f3e (diff)
merge with trunk
Diffstat (limited to 'bin/nova-api')
-rwxr-xr-xbin/nova-api18
1 files changed, 13 insertions, 5 deletions
diff --git a/bin/nova-api b/bin/nova-api
index fff67251f..fe8e83366 100755
--- a/bin/nova-api
+++ b/bin/nova-api
@@ -24,8 +24,10 @@ Starts both the EC2 and OpenStack APIs in separate processes.
"""
import os
+import signal
import sys
+
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(
sys.argv[0]), os.pardir, os.pardir))
if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
@@ -34,17 +36,23 @@ if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
import nova.service
import nova.utils
+from nova import flags
+
+
+FLAGS = flags.FLAGS
+
def main():
"""Launch EC2 and OSAPI services."""
nova.utils.Bootstrapper.bootstrap_binary(sys.argv)
- ec2 = nova.service.WSGIService("ec2")
- osapi = nova.service.WSGIService("osapi")
-
launcher = nova.service.Launcher()
- launcher.launch_service(ec2)
- launcher.launch_service(osapi)
+
+ for api in FLAGS.enabled_apis:
+ service = nova.service.WSGIService(api)
+ launcher.launch_service(service)
+
+ signal.signal(signal.SIGTERM, lambda *_: launcher.stop())
try:
launcher.wait()