Merge lp://staging/~jameinel/juju-core/security-group-group-id-1226996 into lp://staging/juju-core/1.14
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Martin Packman | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1750 | ||||
Proposed branch: | lp://staging/~jameinel/juju-core/security-group-group-id-1226996 | ||||
Merge into: | lp://staging/juju-core/1.14 | ||||
Diff against target: |
238 lines (+144/-9) 4 files modified
environs/jujutest/livetests.go (+4/-0) provider/openstack/export_test.go (+24/-0) provider/openstack/live_test.go (+86/-0) provider/openstack/provider.go (+30/-9) |
||||
To merge this branch: | bzr merge lp://staging/~jameinel/juju-core/security-group-group-id-1226996 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+186321@code.staging.launchpad.net |
Commit message
provider/openstack: bug #1226996 SecurityGroup
We intended to allow access to any port for any instance in the
default security group. However, we didn't specify a CIDR and we
didn't reference the Source Group Id. Which meant we actually were
exposing *all* ports to *all* machines.
https:/
R=fwereade, rogpeppe
Description of the change
provider/openstack: bug #1226996 SecurityGroup
We intended to allow access to any port for any instance in the
default security group. However, we didn't specify a CIDR and we
didn't reference the Source Group Id. Which meant we actually were
exposing *all* ports to *all* machines.
I do have some tests that the security group we get back from
EnsureGroup has the right bits set. I was hoping for a slightly better
cross-provider test that actually runs a service on a random port and
ensures that we are unable to actually connect to that port.
However, I think this is a nice small fix for 1.14 which is worthy of
landing.
Reviewers: mp+186321_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/openstack: bug #1226996 SecurityGroup
We intended to allow access to any port for any instance in the
default security group. However, we didn't specify a CIDR and we
didn't reference the Source Group Id. Which meant we actually were
exposing *all* ports to *all* machines.
I do have some tests that the security group we get back from
EnsureGroup has the right bits set. I was hoping for a slightly better
cross-provider test that actually runs a service on a random port and
ensures that we are unable to actually connect to that port.
However, I think this is a nice small fix for 1.14 which is worthy of
landing.
https:/ /code.launchpad .net/~jameinel/ juju-core/ security- group-group- id-1226996/ +merge/ 186321
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13562045/
Affected files (+71, -0 lines): openstack/ export_ test.go openstack/ live_test. go openstack/ provider. go
A [revision details]
M provider/
M provider/
M provider/
Index: [revision details] 20130917234003- 54re4ia2qmlq7xt 3
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: provider/ openstack/ export_ test.go openstack/ export_ test.go' openstack/ export_ test.go 2013-08-21 01:31:34 +0000 openstack/ export_ test.go 2013-09-18 10:25:42 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -9,6 +9,7 @@
"strings"
"text/template"
+ "launchpad. net/goose/ errors" net/goose/ identity" net/goose/ nova" net/goose/ swift" icStorage( e).Remove( productMetadata file)
"launchpad.
"launchpad.
"launchpad.
@@ -235,6 +236,25 @@
WritablePubl
}
+// DiscardSecurity Group cleans up a security group, it is not an error to Group(e environs.Environ, name string) error { SecurityGroupBy Name(name) IsNotFound( err) { DeleteSecurityG roup(group. Id) InstanceSpec, err error) { c(env, &instances. InstanceConstra int{
+// delete something that doesn't exist.
+func DiscardSecurity
+ env := e.(*environ)
+ novaClient := env.nova()
+ group, err := novaClient.
+ if err != nil {
+ if errors.
+ // Group already deleted, done
+ return nil
+ }
+ }
+ err = novaClient.
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
func FindInstanceSpec(e environs.Environ, series, arch, cons string) (spec
*instances.
env := e.(*environ)
spec, err = findInstanceSpe
Index: provider/ openstack/ live_test. go openstack/ live_test. go' openstack/ live_test. go 2013-08-21 18:38:22 +0000 openstack/ live_test. go 2013-09-18 10:25:42 +0000 net/gocheck" net/goose/ client" net/goose/ identity" net/goose/ nova" net/juju- core/environs" net/juju- core/environs/ jujutest" net/juju- core/environs/ testing" TearDownTest( c) te.TearDownTest ...
=== modified file 'provider/
--- provider/
+++ provider/
@@ -7,9 +7,12 @@
"crypto/rand"
"fmt"
"io"
+
gc "launchpad.
"launchpad.
"launchpad.
+ "launchpad.
+
"launchpad.
"launchpad.
envtesting "launchpad.
@@ -127,3 +130,42 @@
t.LiveTests.
t.LoggingSui