Merge lp:~fwereade/pyjuju/go-environ-placement-policy into lp:pyjuju/go
Proposed by
William Reade
Status: | Merged |
---|---|
Approved by: | Gustavo Niemeyer |
Approved revision: | 196 |
Merged at revision: | 205 |
Proposed branch: | lp:~fwereade/pyjuju/go-environ-placement-policy |
Merge into: | lp:pyjuju/go |
Prerequisite: | lp:~fwereade/pyjuju/go-place-unit |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~fwereade/pyjuju/go-environ-placement-policy |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+108303@code.launchpad.net |
Description of the change
add AssignmentPolicy to Environ
This is very likely to migrate to a Settings type at some stage, but I don't
think that's justified yet.
To post a comment you must log in.
Reviewers: mp+108303_ code.launchpad. net,
Message:
Please take a look.
Description:
add PlacementPolicy to Environ
This is very likely to migrate to a Settings type at some stage, but I
don't
think that's justified yet.
https:/ /code.launchpad .net/~fwereade/ juju/go- environ- placement- policy/ +merge/ 108303
Requires: /code.launchpad .net/~fwereade/ juju/go- place-unit/ +merge/ 108158
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6259062/
Affected files: dummy/environs. go ec2/local_ test.go interface. go
A [revision details]
M environs/
M environs/ec2/ec2.go
M environs/
M environs/
Index: [revision details]
=== 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: <email address hidden>
+New revision: <email address hidden>
Index: environs/ interface. go interface. go' interface. go 2012-05-26 05:51:58 +0000 interface. go 2012-05-31 14:23:53 +0000 Policy
=== modified file 'environs/
--- environs/
+++ environs/
@@ -143,4 +143,7 @@
// yet be visible in the environment, so this method
// can wait until they are.
Destroy(insts []Instance) error
+
+ // PlacementPolicy returns the environment's unit placement policy.
+ PlacementPolicy() state.Placement
}
Index: environs/ dummy/environs. go dummy/environs. go' dummy/environs. go 2012-05-31 07:35:44 +0000 dummy/environs. go 2012-05-31 14:23:53 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -310,6 +310,10 @@
return nil, errors.New("no state info available for this environ")
}
+func (e *environ) PlacementPolicy() state.Placement Policy { signed EnvironConfig) { nfig) x.Lock( )
+ return state.PlaceUnas
+}
+
func (e *environ) SetConfig(cfg environs.
config := cfg.(*environCo
e.configMute
Index: environs/ec2/ec2.go ec2/ec2. go'
=== modified file 'environs/
--- environs/ec2/ec2.go 2012-05-28 21:18:21 +0000
+++ environs/ec2/ec2.go 2012-05-31 14:23:53 +0000
@@ -231,6 +231,12 @@
}, nil
}
+// PlacementPolicy for EC2 is to deploy units only on machines without Policy { signed machineId int, info *state.Info) Printf( "environs/ ec2: starting machine %d in %q", machineId, e.name) (machineId, info, false)
other
+// units already assigned.
+func (e *environ) PlacementPolicy() state.Placement
+ return state.PlaceUnas
+}
+
func (e *environ) StartInstance(
(environs.Instance, error) {
log.
return e.startInstance
Index: environs/ ec2/local_ test.go ec2/local_ test.go' ec2/local_ test.go 2012-05-28 07:46:06 +0000 ec2/local_ test.go 2012-05-31 15:30:20 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -188,6 +188,9 @@
}
func (t *localServerSuite) TestBootstrapIn stanceUserDataA ndState( c *C) { Policy( ) signed) (true)
+ policy := t.env.Placement
+ c.Assert(policy, Equals, state.PlaceUnas
+
err := t.env.Bootstrap
c.Assert(err, IsNil)