Code review comment for lp:~themue/juju-core/go-state-unit-status

Revision history for this message
William Reade (fwereade) wrote :

https://codereview.appspot.com/6454113/diff/3001/state/unit.go
File state/unit.go (right):

https://codereview.appspot.com/6454113/diff/3001/state/unit.go#newcode160
state/unit.go:160: // Status returns the status of the unit.
On 2012/08/07 17:14:58, niemeyer wrote:
> The whole thing is looking good, but it's missing more context of what
this is.
> What does "status of the unit" actually mean? What are the set of
valid values?
> Should these be constants? etc.

How about:

// Status returns the status of the unit's agent. Expected
// results include:
// pending: the agent has not started
// installed: the agent has installed the charm
// started: the agent is running and nothing is wrong
// stopped: the agent has done everything it ever will
// *-error: the agent failed to run the referenced hook
// down: the agent is not functioning correctly

I don't *think* these should be constants, because the set of *-error
states is not predictable.

https://codereview.appspot.com/6454113/diff/3001/state/unit.go#newcode169
state/unit.go:169: }
Actually, sorry, I think it would be nice, at this point, to check
AgentAlive and return "down" if it's not (unless the status is
"stopped").

https://codereview.appspot.com/6454113/

« Back to merge proposal