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

Issue 13908044: apiuniter: Fix lp:1231457 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by dimitern
Modified:
10 years, 7 months ago
Reviewers:
mp+187824, fwereade
Visibility:
Public.

Description

apiuniter: Fix lp:1231457 This changes several params types, while keeping the field names for backward compatibility. And changes the result of ConfigSettings() call to return map[string]interface{}, because charm settings are different from relation settings (which are always strings), and coercing charm settings to stings discards non-string config settings, so this is fixed here. https://code.launchpad.net/~dimitern/juju-core/148-apiuniter-fix-configsettings/+merge/187824 Requires: https://code.launchpad.net/~dimitern/juju-core/147-apiprovisioner-blank-env-secrets/+merge/187738 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5

Patch Set 2 : apiuniter: Fix lp:1231457 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -113 lines) Patch
[revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
state/api/params/internal.go View 2 chunks +37 lines, -22 lines 0 comments Download
state/api/provisioner/provisioner.go View 1 chunk +1 line, -1 line 0 comments Download
state/api/uniter/relationunit.go View 2 chunks +3 lines, -3 lines 0 comments Download
state/api/uniter/relationunit_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
state/api/uniter/settings.go View 3 chunks +6 lines, -6 lines 0 comments Download
state/api/uniter/settings_test.go View 5 chunks +11 lines, -11 lines 0 comments Download
state/api/uniter/unit.go View 1 2 chunks +2 lines, -10 lines 0 comments Download
state/apiserver/provisioner/provisioner.go View 2 chunks +3 lines, -2 lines 0 comments Download
state/apiserver/provisioner/provisioner_test.go View 1 chunk +1 line, -1 line 0 comments Download
state/apiserver/uniter/uniter.go View 1 7 chunks +24 lines, -19 lines 0 comments Download
state/apiserver/uniter/uniter_test.go View 1 6 chunks +64 lines, -12 lines 0 comments Download
worker/uniter/context.go View 2 chunks +2 lines, -2 lines 0 comments Download
worker/uniter/context_test.go View 7 chunks +15 lines, -15 lines 0 comments Download
worker/uniter/jujuc/context.go View 1 chunk +2 lines, -2 lines 0 comments Download
worker/uniter/jujuc/relation-get.go View 1 chunk +1 line, -1 line 0 comments Download
worker/uniter/jujuc/util_test.go View 3 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 3
dimitern
Please take a look.
10 years, 7 months ago (2013-09-26 15:53:14 UTC) #1
fwereade
LGTM with an error return on unexpected relation settings. https://codereview.appspot.com/13908044/diff/1/state/api/params/internal.go File state/api/params/internal.go (right): https://codereview.appspot.com/13908044/diff/1/state/api/params/internal.go#newcode138 state/api/params/internal.go:138: ...
10 years, 7 months ago (2013-09-26 16:11:51 UTC) #2
dimitern
10 years, 7 months ago (2013-09-26 17:25:25 UTC) #3
Please take a look.

https://codereview.appspot.com/13908044/diff/1/state/api/uniter/unit.go
File state/api/uniter/unit.go (right):

https://codereview.appspot.com/13908044/diff/1/state/api/uniter/unit.go#newco...
state/api/uniter/unit.go:143: return map[string]interface{}(result.Settings),
nil
On 2013/09/26 16:11:52, fwereade wrote:
> can you not do charm.Settings(result.Settings)?

Done.

https://codereview.appspot.com/13908044/diff/1/state/apiserver/uniter/uniter.go
File state/apiserver/uniter/uniter.go (left):

https://codereview.appspot.com/13908044/diff/1/state/apiserver/uniter/uniter....
state/apiserver/uniter/uniter.go:797: // All relation settings should be
strings.
On 2013/09/26 16:11:52, fwereade wrote:
> Hmm. This is almost legitimate-panic territory. Best not, since we're running
in
> the API server and will cause a lot of collateral damage, but I think we
should
> at least error out -- if it happens, we're clearly not in Kansas any more.

Done. Also added a couple of tests for the error.
Sign in to reply to this message.

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