Merge lp:~axwalk/juju-core/fix-supportsunitplacement-injectmachine into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2557 |
Proposed branch: | lp:~axwalk/juju-core/fix-supportsunitplacement-injectmachine |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
57 lines (+19/-3) 2 files modified
state/addmachine.go (+2/-2) state/environcapability_test.go (+17/-1) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/fix-supportsunitplacement-injectmachine |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+213989@code.launchpad.net |
Commit message
state: no pre-checks for injected machines
We should not be second guessing the bootstrap agent or
manual provisioning. If the instance-id is non-empty when
adding a machine to state, do not check SupportsUnitPla
Description of the change
state: no pre-checks for injected machines
We should not be second guessing the bootstrap agent or
manual provisioning. If the instance-id is non-empty when
adding a machine to state, do not check SupportsUnitPla
To post a comment you must log in.
Reviewers: mp+213989_ code.launchpad. net,
Message:
Please take a look.
Description:
state: no pre-checks for injected machines
We should not be second guessing the bootstrap agent or cement.
manual provisioning. If the instance-id is non-empty when
adding a machine to state, do not check SupportsUnitPla
https:/ /code.launchpad .net/~axwalk/ juju-core/ fix-supportsuni tplacement- injectmachine/ +merge/ 213989
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/83940043/
Affected files (+20, -2 lines): pability_ test.go
A [revision details]
M state/addmachine.go
M state/environca
Index: [revision details] 20140403093134- znbl1cwzwu3cb3e s
=== 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: state/addmachine.go addmachine. go' principals) == 0 { principals) == 0 && template.InstanceId == "" { Placement( ); err != nil {
=== modified file 'state/
--- state/addmachine.go 2014-04-03 04:03:00 +0000
+++ state/addmachine.go 2014-04-03 09:52:10 +0000
@@ -135,7 +135,7 @@
for _, template := range templates {
// Adding a machine without any principals is
// only permitted unit placement is supported.
- if len(template.
+ if len(template.
if err := st.supportsUnit
return nil, err
}
Index: state/environca pability_ test.go environcapabili ty_test. go' pability_ test.go 2014-04-03 03:37:45 +0000 pability_ test.go 2014-04-03 09:52:10 +0000
=== modified file 'state/
--- state/environca
+++ state/environca
@@ -52,6 +52,15 @@
})
}
+func (s *EnvironCapabil itySuite) addOneMachineWi thInstanceId( c *gc.C) AddOneMachine( state.MachineTe mplate{ MachineJob{ state.JobHostUn its}, itySuite) addMachineInsid eNewMachine( c *gc.C) error mplate{
(*state.Machine, error) {
+ return s.State.
+ Series: "quantal",
+ Jobs: []state.
+ InstanceId: "i-rate",
+ Nonce: "ya",
+ })
+}
+
func (s *EnvironCapabil
{
template := state.MachineTe
Series: "quantal",
@@ -62,7 +71,7 @@
}
func (s *EnvironCapabil itySuite) TestSupportsUni tPlacementAddMa chine(c cement returns an .supportsUnitPl acementError = fmt.Errorf("no add-machine for
*gc.C) {
- // Ensure that AddOneMachine fails when PrecheckInstance returns an error.
+ // Ensure that AddOneMachine fails when SupportsUnitPla
error.
s.capability
you")
_, err := s.addOneMachine(c)
c.Assert(err, gc.ErrorMatches, ".*no add-machine for you")
@@ -76,6 +85,13 @@
c.Assert(err, gc.ErrorMatches, ".*incapable of EnvironCapability")
}
+func (s *EnvironCapabil itySuite) tPlacementAddMa chineInstanceId (c *gc.C) { supportsUnitPla cementError = fmt.Errorf("no add-machine for WithInstanceId( c) itySuite) TestSupportsUni tPlacementUnitA ssignment( c
TestSupportsUni
+ // Ensure that AddOneMachine with a non-empty InstanceId does not fail.
+ s.capability.
you")
+ _, err := s.addOneMachine
+ c.Assert(err, gc.IsNil)
+}
+
func (s *EnvironCapabil
*gc.C) {
m, err := s.addOneMachine(c)
c.Assert(err, gc.IsNil)