Merge lp:~themue/juju-core/go-mstate-machine-agent-alive into lp:~juju/juju-core/trunk
Proposed by
Frank Mueller
Status: | Merged |
---|---|
Approved by: | Gustavo Niemeyer |
Approved revision: | no longer in the source branch. |
Merged at revision: | 473 |
Proposed branch: | lp:~themue/juju-core/go-mstate-machine-agent-alive |
Merge into: | lp:~juju/juju-core/trunk |
Prerequisite: | lp:~themue/juju-core/go-mstate-unit-status |
Diff against target: |
140 lines (+96/-0) (has conflicts) 2 files modified
mstate/machine.go (+51/-0) mstate/machine_test.go (+45/-0) Text conflict in mstate/state.go |
To merge this branch: | bzr merge lp:~themue/juju-core/go-mstate-machine-agent-alive |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
The Go Language Gophers | Pending | ||
Review via email: mp+122819@code.launchpad.net |
Description of the change
mstate: added agent alive methods
Machine provides AgentAlive(), WaitAgentAlive() and
SetAgentAlive() using the presence package.
To post a comment you must log in.
Nice, LGTM.
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine. go
File mstate/machine.go (right):
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine. go#newcode82 machine. go:82: func (m *Machine) WaitAgentAlive( timeout
mstate/
time.Duration) error {
Nice implementation.
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine. go#newcode101 machine. go:101: panic(fmt. Sprintf( "unexpected alive status of
mstate/
machine %v", m))
"presence reported dead status twice in a row for machine %v"
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine. go#newcode109 machine. go:109: // by starting a pinger on its presence node. It
mstate/
returns the
Please drop the "by starting a pinger on its presence node" part. This
isn't entirely true anymore, and isn't really necessary given the rest
of the doc.
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine_ test.go machine_ test.go (right):
File mstate/
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine_ test.go# newcode31 machine_ test.go: 31: defer pinger.Kill()
mstate/
s/Kill/Stop/
We only care that it's not running after the test is done.
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine_ test.go# newcode50 machine_ test.go: 50: c.Assert(pinger, Not(IsNil))
mstate/
This check isn't necessary. We'd go crazy if we had to check everything
that is *not* nil when err is nil.
https:/ /codereview. appspot. com/6498091/ diff/1/ mstate/ machine_ test.go# newcode60 machine_ test.go: 60: pinger.Kill()
mstate/
err := pinger.Kill()
c.Assert(err, IsNil)
https:/ /codereview. appspot. com/6498091/