Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(737)

Unified Diff: cmd/jujud/machine.go

Issue 8561045: finish nonced provisioning (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cmd/jujud/machine.go
=== modified file 'cmd/jujud/machine.go'
--- cmd/jujud/machine.go 2013-04-05 13:47:17 +0000
+++ cmd/jujud/machine.go 2013-04-09 13:25:23 +0000
@@ -127,7 +127,17 @@
}
func (a *MachineAgent) Entity(st *state.State) (AgentState, error) {
- return st.Machine(a.MachineId)
+ m, err := st.Machine(a.MachineId)
+ if err != nil {
+ return nil, err
+ }
+ // Check the machine nonce as provisioned matches the agent.Conf value.
+ if m.CheckProvisioned(a.Conf.MachineNonce) {
fwereade 2013/04/09 21:27:21 I'd prefer to invert this and have the error retur
dimitern 2013/04/10 12:36:40 Done.
+ return m, nil
+ }
+ // Not provisioned -> no need to run the agent further.
fwereade 2013/04/09 21:27:21 // The agent is running on a different machine to
dimitern 2013/04/10 12:36:40 Done.
+ log.Errorf("cmd/jujud: tried to start an agent for unprovisioned machine %q", m)
+ return nil, worker.ErrTerminateAgent
}
func (a *MachineAgent) Tag() string {
« no previous file with comments | « [revision details] ('k') | cmd/jujud/machine_test.go » ('j') | trivial/uuid.go » ('J')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b