diff options
| author | matt.dietz@rackspace.com <> | 2011-07-11 11:16:22 -0500 |
|---|---|---|
| committer | matt.dietz@rackspace.com <> | 2011-07-11 11:16:22 -0500 |
| commit | 722cd2b16f25b334cacad4bcc9df42202ea33166 (patch) | |
| tree | 671fc6ea2a01e4fe3ac198e8ba6a72ea58f26ae0 /bin/nova-api | |
| parent | 7142aa734c1e77a6efacac5bff918b44240b7a1a (diff) | |
| parent | d682fb4431050d97f09fb9677f6dc8d242e68d74 (diff) | |
| download | nova-722cd2b16f25b334cacad4bcc9df42202ea33166.tar.gz nova-722cd2b16f25b334cacad4bcc9df42202ea33166.tar.xz nova-722cd2b16f25b334cacad4bcc9df42202ea33166.zip | |
Merge from trunk
Diffstat (limited to 'bin/nova-api')
| -rw-r--r-- | bin/nova-api | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/bin/nova-api b/bin/nova-api index fff67251f..fe8e83366 100644 --- 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() |
