Merge lp:~jameinel/juju-core/1.18-provisioner-no-tools-is-fatal-1311676 into lp:juju-core/1.18
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2274 |
Proposed branch: | lp:~jameinel/juju-core/1.18-provisioner-no-tools-is-fatal-1311676 |
Merge into: | lp:juju-core/1.18 |
Diff against target: |
74 lines (+43/-2) 3 files modified
testing/constants.go (+1/-1) worker/provisioner/provisioner_task.go (+7/-1) worker/provisioner/provisioner_test.go (+35/-0) |
To merge this branch: | bzr merge lp:~jameinel/juju-core/1.18-provisioner-no-tools-is-fatal-1311676 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+217011@code.launchpad.net |
Commit message
worker/provisioner: no tools is an error
We were treating no tools found as an error of the Provisioner, rather
than an error with the machine we were trying to provision (bug
#1311676). This now sets the status of the machine to an error state,
which lets us continue with our lives.
In the original bug about not having tools, it was shown that in the
local provider, doing
juju bootstrap -e local
juju deploy -e local precise/ubuntu
juju deploy -e local trusty/ubuntu ubuntu-t
Would end up with both machines stuck in Pending. Now it says:
$ juju status -e local
environment: local
machines:
"0":
agent-state: started
agent-version: 1.18.2.1
dns-name: localhost
instance-id: localhost
series: trusty
"1":
agent-
instance-id: pending
series: precise
"2":
agent-state: started
agent-version: 1.18.2.1
dns-name: 10.0.3.194
instance-id: jameinel-
series: trusty
hardware: arch=amd64
And you can see that it succeeded in deploying trusty because it put
precise into an error state.
Description of the change
worker/provisioner: no tools is an error
We were treating no tools found as an error of the Provisioner, rather
than an error with the machine we were trying to provision (bug
#1311676). This now sets the status of the machine to an error state,
which lets us continue with our lives.
In the original bug about not having tools, it was shown that in the
local provider, doing
juju bootstrap -e local
juju deploy -e local precise/ubuntu
juju deploy -e local trusty/ubuntu ubuntu-t
Would end up with both machines stuck in Pending. Now it says:
$ juju status -e local
environment: local
machines:
"0":
agent-state: started
agent-version: 1.18.2.1
dns-name: localhost
instance-id: localhost
series: trusty
"1":
agent-
instance-id: pending
series: precise
"2":
agent-state: started
agent-version: 1.18.2.1
dns-name: 10.0.3.194
instance-id: jameinel-
series: trusty
hardware: arch=amd64
And you can see that it succeeded in deploying trusty because it put
precise into an error state.
Reviewers: mp+217011_ code.launchpad. net,
Message:
Please take a look.
Description:
worker/provisioner: no tools is an error
We were treating no tools found as an error of the Provisioner, rather
than an error with the machine we were trying to provision (bug
#1311676). This now sets the status of the machine to an error state,
which lets us continue with our lives.
In the original bug about not having tools, it was shown that in the
local provider, doing
juju bootstrap -e local
juju deploy -e local precise/ubuntu
juju deploy -e local trusty/ubuntu ubuntu-t
Would end up with both machines stuck in Pending. Now it says: state-info: '(error: no matching tools available)' local-machine- 2
$ juju status -e local
environment: local
machines:
"0":
agent-state: started
agent-version: 1.18.2.1
dns-name: localhost
instance-id: localhost
series: trusty
"1":
agent-
instance-id: pending
series: precise
"2":
agent-state: started
agent-version: 1.18.2.1
dns-name: 10.0.3.194
instance-id: jameinel-
series: trusty
hardware: arch=amd64
And you can see that it succeeded in deploying trusty because it put
precise into an error state.
https:/ /code.launchpad .net/~jameinel/ juju-core/ 1.18-provisione r-no-tools- is-fatal- 1311676/ +merge/ 217011
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/93720044/
Affected files (+44, -1 lines): provisioner/ provisioner_ task.go provisioner/ provisioner_ test.go
A [revision details]
M worker/
M worker/
Index: [revision details] 20140412095413- 8rps4bhva01cu0o 9
=== 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: worker/ provisioner/ provisioner_ task.go provisioner/ provisioner_ task.go' provisioner/ provisioner_ task.go 2014-04-02 08:44:20 +0000 provisioner/ provisioner_ task.go 2014-04-24 09:10:44 +0000 ols(series, cons) Errorf( "cannot find tools for machine %q: %v", machine, err) SetStatus( params. StatusError, err.Error(), nil); Errorf( "cannot set error status for machine %q: %v", machine, fig(machine)
=== modified file 'worker/
--- worker/
+++ worker/
@@ -419,7 +419,13 @@
}
possibleTools, err := task.possibleTo
if err != nil {
- return err
+ logger.
+ if err1 := machine.
err1 != nil {
+ // Something is wrong with this machine, better report it back.
+ logger.
err1)
+ return err1
+ }
+ return nil
}
machineConfig, err := task.machineCon
if err != nil {
Index: worker/ provisioner/ provisioner_ test.go provisioner/ provisioner_ test.go' provisioner/ provisioner_ test.go 2014-04-03 19:11:11 +0000 provisioner/ provisioner_ test.go 2014-04-24 09:10:44 +0000 InstanceCustom( c, m, "pork", cons)
=== modified file 'worker/
--- worker/
+++ worker/
@@ -390,6 +390,41 @@
s.checkStart
}
+func (s *ProvisionerSuite) SetsErrorStatus WhenNoToolsAreA vailable( c *gc.C) { visioner( c)
TestProvisioner
+ p := s.newEnvironPro
+ defer stop(c, p)
+
+ // Check that an instance is not provisioned when the mach...