Merge lp:~clint-fewbar/pyjuju/open-udp-ports into lp:pyjuju

Proposed by Clint Byrum
Status: Merged
Approved by: Kapil Thangavelu
Approved revision: 579
Merged at revision: 582
Proposed branch: lp:~clint-fewbar/pyjuju/open-udp-ports
Merge into: lp:pyjuju
Diff against target: 57 lines (+25/-0)
3 files modified
juju/providers/openstack/ports.py (+3/-0)
juju/providers/openstack/tests/test_bootstrap.py (+11/-0)
juju/providers/openstack/tests/test_ports.py (+11/-0)
To merge this branch: bzr merge lp:~clint-fewbar/pyjuju/open-udp-ports
Reviewer Review Type Date Requested Status
Kapil Thangavelu (community) Approve
Martin Packman (community) Needs Information
Review via email: mp+125099@code.launchpad.net

Description of the change

Opens UDP ports the same way TCP ports are opened

Opens UDP ports the same way TCP ports are opened

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Going by the current contents of nova/compute/api.py you could instead omit the protocol and ports to permit all icmp/tcp/udp traffic internally. Is that preferable?

review: Needs Information
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Perhaps that could work too. I feel that this is a case where being explicit might be a good thing, as I want to specifically make it "just like ec2" not "as awesome as possible".

Revision history for this message
Martin Packman (gz) wrote :

It's not completely explict, but by not passing ip_protocol or ports params to .authorize_security_group, the EC2 provider is effectively using the same logic that omitting the protocol and ports would with openstack.

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'juju/providers/openstack/ports.py'
2--- juju/providers/openstack/ports.py 2012-07-20 16:14:11 +0000
3+++ juju/providers/openstack/ports.py 2012-09-19 05:38:17 +0000
4@@ -122,6 +122,9 @@
5 yield self.nova.add_security_group_rule(
6 parent_group_id=sg['id'], group_id=sg['id'],
7 ip_protocol="tcp", from_port=1, to_port=65535)
8+ yield self.nova.add_security_group_rule(
9+ parent_group_id=sg['id'], group_id=sg['id'],
10+ ip_protocol="udp", from_port=1, to_port=65535)
11
12 machine_group = self._machine_group_name(machine_id)
13 if machine_group in groups_by_name:
14
15=== modified file 'juju/providers/openstack/tests/test_bootstrap.py'
16--- juju/providers/openstack/tests/test_bootstrap.py 2012-09-10 03:20:20 +0000
17+++ juju/providers/openstack/tests/test_bootstrap.py 2012-09-19 05:38:17 +0000
18@@ -53,6 +53,17 @@
19 response={'security_group_rule': {
20 'id': 145, 'parent_group_id': 1,
21 }})
22+ self.expect_nova_post("os-security-group-rules",
23+ {'security_group_rule': {
24+ 'parent_group_id': 1,
25+ 'group_id': 1,
26+ 'ip_protocol': "udp",
27+ 'from_port': 1,
28+ 'to_port': 65535,
29+ }},
30+ response={'security_group_rule': {
31+ 'id': 146, 'parent_group_id': 1,
32+ }})
33
34 def expect_create_machine_group(self, machine_id):
35 machine = str(machine_id)
36
37=== modified file 'juju/providers/openstack/tests/test_ports.py'
38--- juju/providers/openstack/tests/test_ports.py 2012-07-18 21:17:01 +0000
39+++ juju/providers/openstack/tests/test_ports.py 2012-09-19 05:38:17 +0000
40@@ -209,6 +209,17 @@
41 response={'security_group_rule': {
42 'id': 145, 'parent_group_id': 1,
43 }})
44+ self.expect_nova_post("os-security-group-rules",
45+ {'security_group_rule': {
46+ 'parent_group_id': 1,
47+ 'group_id': 1,
48+ 'ip_protocol': "udp",
49+ 'from_port': 1,
50+ 'to_port': 65535,
51+ }},
52+ response={'security_group_rule': {
53+ 'id': 146, 'parent_group_id': 1,
54+ }})
55
56 def expect_create_machine_group(self, machine_id):
57 machine = str(machine_id)

Subscribers

People subscribed via source and target branches

to status/vote changes: