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
1=== modified file 'bin/nova-api'
2--- bin/nova-api 2010-11-02 18:28:14 +0000
3+++ bin/nova-api 2010-11-03 20:16:12 +0000
4@@ -38,15 +38,17 @@
5
6 FLAGS = flags.FLAGS
7 flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
8+flags.DEFINE_string('osapi_host', '0.0.0.0', 'OpenStack API host')
9 flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port')
10+flags.DEFINE_string('ec2api_host', '0.0.0.0', 'EC2 API host')
11
12
13 def main(_args):
14 from nova import api
15 from nova import wsgi
16 server = wsgi.Server()
17- server.start(api.API('os'), FLAGS.osapi_port)
18- server.start(api.API('ec2'), FLAGS.ec2api_port)
19+ server.start(api.API('os'), FLAGS.osapi_port, host=FLAGS.osapi_host)
20+ server.start(api.API('ec2'), FLAGS.ec2api_port, host=FLAGS.ec2api_host)
21 server.wait()
22
23
24
25=== modified file 'nova/objectstore/handler.py'
26--- nova/objectstore/handler.py 2010-10-25 10:21:09 +0000
27+++ nova/objectstore/handler.py 2010-11-03 20:16:12 +0000
28@@ -61,6 +61,7 @@
29
30
31 FLAGS = flags.FLAGS
32+flags.DEFINE_string('s3_listen_host', '', 'Host to listen on.')
33
34
35 def render_xml(request, value):
36@@ -438,6 +439,7 @@
37 # Disabled because of lack of proper introspection in Twisted
38 # or possibly different versions of twisted?
39 # pylint: disable-msg=E1101
40- objectStoreService = internet.TCPServer(FLAGS.s3_port, factory)
41+ objectStoreService = internet.TCPServer(FLAGS.s3_port, factory,
42+ interface=FLAGS.s3_listen_host)
43 objectStoreService.setServiceParent(application)
44 return application