Merge lp:~soren/nova/nova-api-new-daemonise into lp:~gundlach/nova/controllers-in-api

Proposed by Soren Hansen
Status: Merged
Approved by: Michael Gundlach
Approved revision: 309
Merge reported by: Michael Gundlach
Merged at revision: not available
Proposed branch: lp:~soren/nova/nova-api-new-daemonise
Merge into: lp:~gundlach/nova/controllers-in-api
Diff against target: 26 lines (+9/-4)
1 file modified
bin/nova-api-new (+9/-4)
To merge this branch: bzr merge lp:~soren/nova/nova-api-new-daemonise
Reviewer Review Type Date Requested Status
Michael Gundlach Approve
Review via email: mp+36444@code.launchpad.net

Description of the change

Wrap WSGI container in server.serve to make it properly handle command line arguments as well as daemonise properly.

Delay api and wsgi imports (to delay eventlet import, really) to avoid having eventlet's epoll file descriptor closed by daemonize().

To post a comment you must log in.
Revision history for this message
Michael Gundlach (gundlach) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/nova-api-new'
--- bin/nova-api-new 2010-09-23 13:13:27 +0000
+++ bin/nova-api-new 2010-09-23 13:58:41 +0000
@@ -32,13 +32,18 @@
32if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):32if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
33 sys.path.insert(0, possible_topdir)33 sys.path.insert(0, possible_topdir)
3434
35from nova import api
36from nova import flags35from nova import flags
37from nova import wsgi36from nova import utils
37from nova import server
3838
39FLAGS = flags.FLAGS39FLAGS = flags.FLAGS
40flags.DEFINE_integer('api_port', 8773, 'API port')40flags.DEFINE_integer('api_port', 8773, 'API port')
4141
42def main(_args):
43 from nova import api
44 from nova import wsgi
45 wsgi.run_server(api.API(), FLAGS.api_port)
46
42if __name__ == '__main__':47if __name__ == '__main__':
43 FLAGS(sys.argv)48 utils.default_flagfile()
44 wsgi.run_server(api.API(), FLAGS.api_port)49 server.serve('nova-api', main)

Subscribers

People subscribed via source and target branches

to all changes: