diff options
| author | Jason Koelker <jason@koelker.net> | 2011-06-29 14:42:32 -0500 |
|---|---|---|
| committer | Jason Koelker <jason@koelker.net> | 2011-06-29 14:42:32 -0500 |
| commit | 4f3ef1a568caecb26b57c757316a3cdfda20cc31 (patch) | |
| tree | 39f602af3f7edf199cdee1bc1bbaa0a091bd9f03 /bin | |
| parent | 8e09478b8de752909f5937668b44d7f67d7719ed (diff) | |
| parent | 89756b879e7094876697a2380e56c26796d50878 (diff) | |
| download | nova-4f3ef1a568caecb26b57c757316a3cdfda20cc31.tar.gz nova-4f3ef1a568caecb26b57c757316a3cdfda20cc31.tar.xz nova-4f3ef1a568caecb26b57c757316a3cdfda20cc31.zip | |
merge with trey
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-ajax-console-proxy | 5 | ||||
| -rwxr-xr-x | bin/nova-api | 53 | ||||
| -rwxr-xr-x | bin/nova-direct-api | 7 | ||||
| -rwxr-xr-x | bin/nova-objectstore | 7 | ||||
| -rwxr-xr-x | bin/nova-vncproxy | 7 |
5 files changed, 39 insertions, 40 deletions
diff --git a/bin/nova-ajax-console-proxy b/bin/nova-ajax-console-proxy index d88f59e40..21cf68007 100755 --- a/bin/nova-ajax-console-proxy +++ b/bin/nova-ajax-console-proxy @@ -137,8 +137,9 @@ if __name__ == '__main__': utils.default_flagfile() FLAGS(sys.argv) logging.setup() - server = wsgi.Server() + acp_port = FLAGS.ajax_console_proxy_port acp = AjaxConsoleProxy() acp.register_listeners() - server.start(acp, FLAGS.ajax_console_proxy_port, host='0.0.0.0') + server = wsgi.Server("AJAX Console Proxy", acp, port=acp_port) + server.start() server.wait() diff --git a/bin/nova-api b/bin/nova-api index a1088c23d..ea99a1b48 100755 --- a/bin/nova-api +++ b/bin/nova-api @@ -1,5 +1,4 @@ #!/usr/bin/env python -# pylint: disable=C0103 # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the @@ -18,44 +17,34 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Starter script for Nova API.""" +"""Starter script for Nova API. + +Starts both the EC2 and OpenStack APIs in separate processes. + +""" -import gettext -import os import sys -# 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]), - os.pardir, - os.pardir)) -if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): - sys.path.insert(0, possible_topdir) +import nova.service +import nova.utils + -gettext.install('nova', unicode=1) +def main(): + """Launch EC2 and OSAPI services.""" + nova.utils.Bootstrapper.bootstrap_binary(sys.argv) -from nova import flags -from nova import log as logging -from nova import service -from nova import utils -from nova import version -from nova import wsgi + ec2 = nova.service.WSGIService("ec2") + osapi = nova.service.WSGIService("osapi") + launcher = nova.service.Launcher() + launcher.launch_service(ec2) + launcher.launch_service(osapi) -LOG = logging.getLogger('nova.api') + try: + launcher.wait() + except KeyboardInterrupt: + launcher.stop() -FLAGS = flags.FLAGS if __name__ == '__main__': - utils.default_flagfile() - FLAGS(sys.argv) - logging.setup() - LOG.audit(_("Starting nova-api node (version %s)"), - version.version_string_with_vcs()) - LOG.debug(_("Full set of FLAGS:")) - for flag in FLAGS: - flag_get = FLAGS.get(flag, None) - LOG.debug("%(flag)s : %(flag_get)s" % locals()) - - service = service.serve_wsgi(service.ApiService) - service.wait() + sys.exit(main()) diff --git a/bin/nova-direct-api b/bin/nova-direct-api index 83ec72722..c6cf9b2ff 100755 --- a/bin/nova-direct-api +++ b/bin/nova-direct-api @@ -93,6 +93,9 @@ if __name__ == '__main__': with_req = direct.PostParamsMiddleware(with_json) with_auth = direct.DelegatedAuthMiddleware(with_req) - server = wsgi.Server() - server.start(with_auth, FLAGS.direct_port, host=FLAGS.direct_host) + server = wsgi.Server("Direct API", + with_auth, + host=FLAGS.direct_host, + port=FLAGS.direct_port) + server.start() server.wait() diff --git a/bin/nova-objectstore b/bin/nova-objectstore index 6ef841b85..1aef3a255 100755 --- a/bin/nova-objectstore +++ b/bin/nova-objectstore @@ -50,6 +50,9 @@ if __name__ == '__main__': FLAGS(sys.argv) logging.setup() router = s3server.S3Application(FLAGS.buckets_path) - server = wsgi.Server() - server.start(router, FLAGS.s3_port, host=FLAGS.s3_host) + server = wsgi.Server("S3 Objectstore", + router, + port=FLAGS.s3_port, + host=FLAGS.s3_host) + server.start() server.wait() diff --git a/bin/nova-vncproxy b/bin/nova-vncproxy index ccb97e3a3..72271df3a 100755 --- a/bin/nova-vncproxy +++ b/bin/nova-vncproxy @@ -96,6 +96,9 @@ if __name__ == "__main__": service.serve() - server = wsgi.Server() - server.start(with_auth, FLAGS.vncproxy_port, host=FLAGS.vncproxy_host) + server = wsgi.Server("VNC Proxy", + with_auth, + host=FLAGS.vncproxy_host, + port=FLAGS.vncproxy_port) + server.start() server.wait() |
