diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2011-07-12 12:13:02 -0400 |
|---|---|---|
| committer | Alex Meade <alex.meade@rackspace.com> | 2011-07-12 12:13:02 -0400 |
| commit | cbcef100c16cc7368527c064ecc6fc7697928153 (patch) | |
| tree | 77d76e4fd7aff58ecca9b0b4ac2bd01b9011d922 /bin | |
| parent | 50357685282b9200ccc8c82361c5266f1f413531 (diff) | |
| parent | 76fbcb9bfd88a56c5a3419bf227cca28334f6844 (diff) | |
merged trunk
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-api | 18 |
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() |
