Merge lp:~eday/nova/lp613264 into lp:~hudson-openstack/nova/trunk

Proposed by Eric Day
Status: Merged
Approved by: Soren Hansen
Approved revision: 393
Merged at revision: 411
Proposed branch: lp:~eday/nova/lp613264
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 44 lines (+7/-3)
2 files modified
bin/nova-api (+4/-2)
nova/objectstore/handler.py (+3/-1)
To merge this branch: bzr merge lp:~eday/nova/lp613264
Reviewer Review Type Date Requested Status
Soren Hansen (community) Approve
Devin Carlen (community) Approve
Review via email: mp+40012@code.launchpad.net

Description of the change

Allows user to specify hosts to listen on for nova-api and -objectstore

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Soren Hansen (soren) wrote :

On 03-11-2010 20:44, Eric Day wrote:
> === modified file 'bin/nova-api'
> --- bin/nova-api 2010-11-02 18:28:14 +0000
> +++ bin/nova-api 2010-11-03 19:44:44 +0000
> @@ -38,15 +38,17 @@
>
> FLAGS = flags.FLAGS
> flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
> +flags.DEFINE_string('osapi_host', '0.0.0.0', 'OpenStack API host')
> flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port')
> +flags.DEFINE_string('ec2api_host', '0.0.0.0', 'EC2 API host')

Perhaps we should add a note about being ipv4-only (not your fault,
eventlet seems to be that way by default anyway (eventlet.listen has a
kwarg defining the address family. It defaults to 2 (AF_INET))).

> === modified file 'nova/objectstore/handler.py'
> --- nova/objectstore/handler.py 2010-10-25 10:21:09 +0000
> +++ nova/objectstore/handler.py 2010-11-03 19:44:44 +0000
> @@ -438,6 +438,7 @@
> # Disabled because of lack of proper introspection in Twisted
> # or possibly different versions of twisted?
> # pylint: disable-msg=E1101
> - objectStoreService = internet.TCPServer(FLAGS.s3_port, factory)
> + objectStoreService = internet.TCPServer(FLAGS.s3_port, factory,
> + interface=FLAGS.s3_host)
> objectStoreService.setServiceParent(application)
> return application

This will effectively make the objectstore listen only on the loopback
device by default and only work on ipv4. Setting interface to '' instead
will make it listen on whatever.

  vote needsfixing

--
Soren Hansen
Ubuntu Developer http://www.ubuntu.com/
OpenStack Developer http://www.openstack.org/

review: Needs Fixing
Revision history for this message
Eric Day (eday) wrote :

I used the s3_host since I figure folks would be setting this in all areas (connect and listen) to match. I separated the two so we have a connect and a listen option now. As var as IPv6, these are just a couple of many places where ipv4 is assumed. One of the summit blueprints is to address ipv6 support, so we can tackle those issues then.

Revision history for this message
Devin Carlen (devcamcar) wrote :

good good

review: Approve
Revision history for this message
Soren Hansen (soren) wrote :

Alright. Only listening on loopback might even be a feature.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/nova-api'
--- bin/nova-api 2010-11-02 18:28:14 +0000
+++ bin/nova-api 2010-11-03 20:16:12 +0000
@@ -38,15 +38,17 @@
3838
39FLAGS = flags.FLAGS39FLAGS = flags.FLAGS
40flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port')40flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
41flags.DEFINE_string('osapi_host', '0.0.0.0', 'OpenStack API host')
41flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port')42flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port')
43flags.DEFINE_string('ec2api_host', '0.0.0.0', 'EC2 API host')
4244
4345
44def main(_args):46def main(_args):
45 from nova import api47 from nova import api
46 from nova import wsgi48 from nova import wsgi
47 server = wsgi.Server()49 server = wsgi.Server()
48 server.start(api.API('os'), FLAGS.osapi_port)50 server.start(api.API('os'), FLAGS.osapi_port, host=FLAGS.osapi_host)
49 server.start(api.API('ec2'), FLAGS.ec2api_port)51 server.start(api.API('ec2'), FLAGS.ec2api_port, host=FLAGS.ec2api_host)
50 server.wait()52 server.wait()
5153
5254
5355
=== modified file 'nova/objectstore/handler.py'
--- nova/objectstore/handler.py 2010-10-25 10:21:09 +0000
+++ nova/objectstore/handler.py 2010-11-03 20:16:12 +0000
@@ -61,6 +61,7 @@
6161
6262
63FLAGS = flags.FLAGS63FLAGS = flags.FLAGS
64flags.DEFINE_string('s3_listen_host', '', 'Host to listen on.')
6465
6566
66def render_xml(request, value):67def render_xml(request, value):
@@ -438,6 +439,7 @@
438 # Disabled because of lack of proper introspection in Twisted439 # Disabled because of lack of proper introspection in Twisted
439 # or possibly different versions of twisted?440 # or possibly different versions of twisted?
440 # pylint: disable-msg=E1101441 # pylint: disable-msg=E1101
441 objectStoreService = internet.TCPServer(FLAGS.s3_port, factory)442 objectStoreService = internet.TCPServer(FLAGS.s3_port, factory,
443 interface=FLAGS.s3_listen_host)
442 objectStoreService.setServiceParent(application)444 objectStoreService.setServiceParent(application)
443 return application445 return application