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

Issue 7069055: worker: trivial machiner

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by fwereade
Modified:
11 years, 3 months ago
Reviewers:
dimitern, mp+142321, TheMue
Visibility:
Public.

Description

worker: trivial machiner Sets Dying machines to Dead. That's it. https://code.launchpad.net/~fwereade/juju-core/machiner-lifecycle/+merge/142321 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : worker: trivial machiner #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -0 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
A worker/machiner/machiner.go View 1 1 chunk +73 lines, -0 lines 0 comments Download
A worker/machiner/machiner_test.go View 1 chunk +47 lines, -0 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
11 years, 3 months ago (2013-01-08 14:28:42 UTC) #1
TheMue
LGTM
11 years, 3 months ago (2013-01-08 14:33:01 UTC) #2
dimitern
On 2013/01/08 14:28:42, fwereade wrote: > Please take a look. LGTM
11 years, 3 months ago (2013-01-08 14:35:53 UTC) #3
rog
not too keen on the name, but i can't think of anything else. looks good, ...
11 years, 3 months ago (2013-01-08 16:22:03 UTC) #4
fwereade
Given 2 LGTMs and justification re NewMachiner awkwardness, submitting. On 2013/01/08 16:22:03, rog wrote: > ...
11 years, 3 months ago (2013-01-08 23:22:54 UTC) #5
fwereade
11 years, 3 months ago (2013-01-08 23:24:33 UTC) #6
*** Submitted:

worker: trivial machiner

Sets Dying machines to Dead. That's it.

R=TheMue, dimitern, rog
CC=
https://codereview.appspot.com/7069055

https://codereview.appspot.com/7069055/diff/1/worker/machiner/machiner.go
File worker/machiner/machiner.go (right):

https://codereview.appspot.com/7069055/diff/1/worker/machiner/machiner.go#new...
worker/machiner/machiner.go:21: func NewMachiner(st *state.State, id string)
*Machiner {
On 2013/01/08 16:22:03, rog wrote:
> since jujud has already fetched the Machine, why not pass it into NewMachiner?
> then you can lose the st argument (i think) and also the code that fetches the
> machine from the state and its error checking.

Because it's already been passed into NewUpgrader and it seems foolish to assume
that it is untainted. I'm +1 on adding Clone methods, as discussed, but it's
worth doing that in a separate CL because I think it will be useful in several
places.

https://codereview.appspot.com/7069055/diff/1/worker/machiner/machiner.go#new...
worker/machiner/machiner.go:62: switch life := m.Life(); life {
On 2013/01/08 16:22:03, rog wrote:
> slightly simpler alternative, perhaps?
> 
> if m.Life() != state.Alive {
>     if err := m.EnsureDead(); err != nil {
>         return err
>     }
>     return worker.ErrDead
> }

Done.
Sign in to reply to this message.

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