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

Issue 7363060: state: upgrade charm for services/units (Closed)

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

Description

state: upgrade charm for services/units This introduces the following changes: - Service.SetCharm now performs validation on the configuration when changing the charm to ensure what's about to be set is compatible with the current service's charm. Also introduces multiple settings per service (one for each unique charm URL), and uses reference counting to manage these and clean them up. - Unit.SetCharm does more sanity checks before changing the unit's charm and also maintains the reference counts of service settings. Fixes LP bug #1063621. https://code.launchpad.net/~dimitern/juju-core/005-upgrade-charm-state-ops/+merge/150750 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: upgrade charm for services/units #

Total comments: 15

Patch Set 3 : state: upgrade charm for services/units #

Total comments: 10

Patch Set 4 : state: upgrade charm for services/units #

Total comments: 2

Patch Set 5 : state: upgrade charm for services/units #

Unified diffs Side-by-side diffs Delta from patch set Stats (+483 lines, -47 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M state/conn_test.go View 1 2 3 3 chunks +22 lines, -3 lines 0 comments Download
M state/export_test.go View 1 2 2 chunks +14 lines, -1 line 0 comments Download
M state/open.go View 1 chunk +1 line, -0 lines 0 comments Download
M state/service.go View 1 2 3 4 8 chunks +201 lines, -20 lines 0 comments Download
M state/service_test.go View 1 2 2 chunks +170 lines, -1 line 0 comments Download
M state/settings.go View 2 chunks +12 lines, -8 lines 0 comments Download
M state/state.go View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M state/unit.go View 2 chunks +51 lines, -11 lines 0 comments Download
M state/unit_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/watcher.go View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8
dimitern
Please take a look.
11 years, 2 months ago (2013-02-27 09:51:38 UTC) #1
dimitern
Please take a look.
11 years, 2 months ago (2013-02-27 09:53:04 UTC) #2
fwereade
LGTM assuming you're ok with the suggestions below. Apart from the docs, the only issue ...
11 years, 2 months ago (2013-02-27 11:21:43 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/7363060/diff/3001/state/export_test.go File state/export_test.go (right): https://codereview.appspot.com/7363060/diff/3001/state/export_test.go#newcode31 state/export_test.go:31: func ServiceSettingsRefCount(st *State, serviceName string, ...
11 years, 2 months ago (2013-02-27 11:50:42 UTC) #4
rog
LGTM with a few trivial remarks below. one question though: why do the settings ref ...
11 years, 2 months ago (2013-02-27 13:08:43 UTC) #5
dimitern
Please take a look. https://codereview.appspot.com/7363060/diff/8001/state/conn_test.go File state/conn_test.go (right): https://codereview.appspot.com/7363060/diff/8001/state/conn_test.go#newcode77 state/conn_test.go:77: func (s *ConnSuite) AddConfigCharm(c *C, ...
11 years, 2 months ago (2013-02-27 13:52:13 UTC) #6
rog
LGTM with one trivial https://codereview.appspot.com/7363060/diff/10002/state/service.go File state/service.go (right): https://codereview.appspot.com/7363060/diff/10002/state/service.go#newcode326 state/service.go:326: decOps, err := settingsDecRefOps(s.st, s.doc.Name, ...
11 years, 2 months ago (2013-02-27 13:55:11 UTC) #7
dimitern
11 years, 2 months ago (2013-02-27 13:58:49 UTC) #8
*** Submitted:

state: upgrade charm for services/units

This introduces the following changes:
- Service.SetCharm now performs validation on the
configuration when changing the charm to ensure
what's about to be set is compatible with the
current service's charm. Also introduces multiple
settings per service (one for each unique charm URL),
and uses reference counting to manage these and clean
them up.
- Unit.SetCharm does more sanity checks before
changing the unit's charm and also maintains the
reference counts of service settings.

Fixes LP bug #1063621.

R=fwereade, rog
CC=
https://codereview.appspot.com/7363060

https://codereview.appspot.com/7363060/diff/10002/state/service.go
File state/service.go (right):

https://codereview.appspot.com/7363060/diff/10002/state/service.go#newcode326
state/service.go:326: decOps, err := settingsDecRefOps(s.st, s.doc.Name,
s.doc.CharmURL) // current charm
On 2013/02/27 13:55:12, rog wrote:
> you can delete the comment at the end of this line now.

Forgot that - fixed!
Sign in to reply to this message.

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