Merge lp:~gz/juju-core/add_startinstance_params into lp:~go-bot/juju-core/trunk
Status: | Merged |
---|---|
Approved by: | Martin Packman |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2445 |
Proposed branch: | lp:~gz/juju-core/add_startinstance_params |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
134 lines (+43/-6) 4 files modified
environs/broker.go (+11/-0) juju/testing/instance.go (+26/-0) provider/common/bootstrap_test.go (+4/-4) provider/common/mock_test.go (+2/-2) |
To merge this branch: | bzr merge lp:~gz/juju-core/add_startinstance_params |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+211588@code.launchpad.net |
Commit message
environs: Added Networks to StartInstanceParams
Added to StartInstanceParams in environ/broker.go
Networks is a simple struct holding two str lists
defining which networks are to be included/excluded
for the started instance.
https:/
R=natefinch
Description of the change
environs: Added Networks to StartInstanceParams
Added to StartInstanceParams in environ/broker.go
Networks is a simple struct holding two str lists
defining which networks are to be included/excluded
for the started instance.
Networks was defined in place for the moment.
Even though I added helpers to the ones already in
place (for Starting instances with constraints)
I did not add specific tests for the added struct.
Reviewers: mp+211588_ code.launchpad. net,
Message:
Please take a look.
Description:
environs: Added Networks to StartInstanceParams
Added to StartInstanceParams in environ/broker.go
Networks is a simple struct holding two str lists
defining which networks are to be included/excluded
for the started instance.
Networks was defined in place for the moment.
Even though I added helpers to the ones already in
place (for Starting instances with constraints)
I did not add specific tests for the added struct.
https:/ /code.launchpad .net/~gz/ juju-core/ add_startinstan ce_params/ +merge/ 211588
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/77490043/
Affected files (+45, -6 lines): instance. go common/ bootstrap_ test.go common/ mock_test. go
A [revision details]
M environs/broker.go
M juju/testing/
M provider/
M provider/
Index: [revision details] 20140318112939- onhi90o40412k44 a
=== 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: environs/broker.go broker. go' net/juju- core/tools"
=== modified file 'environs/
--- environs/broker.go 2014-03-13 05:09:14 +0000
+++ environs/broker.go 2014-03-18 17:18:22 +0000
@@ -10,6 +10,13 @@
"launchpad.
)
+// Networks holds network include/exclude StartInstace method.
+// configuration
+type Networks struct {
+ IncludedNetworks []string
+ ExcludedNetworks []string
+}
+
// StartInstanceParams holds parameters for the
// InstanceBroker.
type StartInstanceParams struct {
@@ -17,6 +24,10 @@
// the kind of instance to create.
Constraints constraints.Value
+ // Networks holds 2 string slices indicating
+ // respectively included and excluded Networks
+ Networks Networks
+
// Tools is a list of tools that may be used
// to start a Juju agent on the machine.
Tools tools.List
Index: juju/testing/ instance. go instance. go' instance. go 2014-03-13 05:09:14 +0000 instance. go 2014-03-18 17:18:22 +0000 Instance, *instance. HardwareCharact eristics, error, thConstraintsAn dNetworks( env, machineId, cons, Networks{ }) anceWithNetwork s is a test helper function that starts an StartInstance. anceWithNetwork s( HardwareCharact eristics, thConstraintsAn dNetworks( env, machineId, thNetworks is a test helper function that starts an StartInstance. thConstraintsAn dNetwor. ..
=== modified file 'juju/testing/
--- juju/testing/
+++ juju/testing/
@@ -85,6 +85,31 @@
) (
instance.
) {
+ return StartInstanceWi
environs.
+}
+
+// AssertStartInst
+// instance with the given networks, and a plausible but invalid
+// configuration, and returns the result of Environ.
+func AssertStartInst
+ c *gc.C, env environs.Environ, machineId string, cons constraints.Value,
nets environs.Networks,
+) (
+ instance.Instance, *instance.
+) {
+ inst, hc, err := StartInstanceWi
cons, nets)
+ c.Assert(err, gc.IsNil)
+ return inst, hc
+}
+
+// StartInstanceWi
instance
+// with the given networks, and a plausible but invalid configuration, and
+// returns the result of Environ.
+func StartInstanceWi