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

Issue 6111053: Adopted needs-upgrade change of Python code (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by TheMue
Modified:
12 years ago
Reviewers:
mp+103486
Visibility:
Public.

Description

Adopted needs-upgrade change of Python code The behavior of the current Python version of the needs-upgrade flag has been modified. It now maintains an internal force flag that can by set from the command line. The Go Unit methods as well as the NeedsUpgradeWatcher now handles this flag too. https://code.launchpad.net/~themue/juju/go-state-unit-needs-upgrade-with-force/+merge/103486 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10

Patch Set 2 : Adopted needs-upgrade change of Python code #

Total comments: 6

Patch Set 3 : Adopted needs-upgrade change of Python code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -43 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M state/state_test.go View 1 2 2 chunks +37 lines, -19 lines 0 comments Download
M state/unit.go View 1 2 6 chunks +62 lines, -17 lines 0 comments Download
M state/watch_test.go View 1 2 1 chunk +7 lines, -7 lines 0 comments Download

Messages

Total messages: 8
TheMue
Please take a look.
12 years ago (2012-04-25 14:29:06 UTC) #1
niemeyer
https://codereview.appspot.com/6111053/diff/1/state/unit.go File state/unit.go (right): https://codereview.appspot.com/6111053/diff/1/state/unit.go#newcode248 state/unit.go:248: return &NeedsUpgrade{false, false}, nil return &NeedsUpgrade{}, nil https://codereview.appspot.com/6111053/diff/1/state/unit.go#newcode251 state/unit.go:251: ...
12 years ago (2012-04-25 15:04:40 UTC) #2
TheMue
Please take a look. https://codereview.appspot.com/6111053/diff/1/state/unit.go File state/unit.go (right): https://codereview.appspot.com/6111053/diff/1/state/unit.go#newcode248 state/unit.go:248: return &NeedsUpgrade{false, false}, nil On ...
12 years ago (2012-04-25 15:30:08 UTC) #3
fwereade
https://codereview.appspot.com/6111053/diff/4001/state/state_test.go File state/state_test.go (right): https://codereview.appspot.com/6111053/diff/4001/state/state_test.go#newcode836 state/state_test.go:836: // Can't be set multipe with different force flag. ...
12 years ago (2012-04-26 14:16:05 UTC) #4
fwereade
Agreed on IRC current behaviour matches python and is fine.
12 years ago (2012-04-26 14:28:25 UTC) #5
niemeyer
LGTM, thanks.
12 years ago (2012-04-26 14:28:53 UTC) #6
fwereade
LGTM https://codereview.appspot.com/6111053/diff/4001/state/watch_test.go File state/watch_test.go (left): https://codereview.appspot.com/6111053/diff/4001/state/watch_test.go#oldcode94 state/watch_test.go:94: time.Sleep(50 * time.Millisecond) On 2012/04/26 14:16:06, fwereade wrote: ...
12 years ago (2012-04-26 14:54:32 UTC) #7
TheMue
12 years ago (2012-04-26 15:12:53 UTC) #8
*** Submitted:

Adopted needs-upgrade change of Python code

The behavior of the current Python version of the needs-upgrade
flag has been modified. It now maintains an internal force flag
that can by set from the command line. The Go Unit methods as
well as the NeedsUpgradeWatcher now handles this flag too.

R=niemeyer, fwereade
CC=
https://codereview.appspot.com/6111053

https://codereview.appspot.com/6111053/diff/4001/state/state_test.go
File state/state_test.go (right):

https://codereview.appspot.com/6111053/diff/4001/state/state_test.go#newcode836
state/state_test.go:836: // Can't be set multipe with different force flag.
(TODO)
On 2012/04/26 14:16:06, fwereade wrote:
> Why not?

Discussed in IRC, stays as implemented in Py.

https://codereview.appspot.com/6111053/diff/4001/state/unit.go
File state/unit.go (right):

https://codereview.appspot.com/6111053/diff/4001/state/unit.go#newcode271
state/unit.go:271: if oldYaml == "" {
On 2012/04/26 14:16:06, fwereade wrote:
> I don't get why we're even checking oldYaml. Shouldn't we always just blat the
> desired state over whatever was there before?

It has to be empty or in a valid state. This way we ensure it and not just
ignore it like a simple writing would do.
Sign in to reply to this message.

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