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

Issue 13274045: Merge tools metadata when writing (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by wallyworld
Modified:
10 years, 7 months ago
Reviewers:
axw1, mp+185402, thumper
Visibility:
Public.

Description

Merge tools metadata when writing If there is already tools metadata present when writing new metadata, do not overwrite it. Instead, merge any new tools records with what's there. https://code.launchpad.net/~wallyworld/juju-core/simplestreams-metadata-merge/+merge/185402 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -35 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/sync/sync.go View 3 chunks +3 lines, -3 lines 0 comments Download
M environs/tools/simplestreams.go View 3 chunks +31 lines, -2 lines 4 comments Download
M environs/tools/simplestreams_test.go View 1 chunk +32 lines, -0 lines 0 comments Download
M environs/tools/tools.go View 3 chunks +37 lines, -28 lines 0 comments Download
M environs/tools/tools_test.go View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4
wallyworld
Please take a look.
10 years, 7 months ago (2013-09-13 02:05:55 UTC) #1
thumper
LGTM - would like a more meaningful name, but it isn't a blocking request. https://codereview.appspot.com/13274045/diff/1/environs/tools/simplestreams.go ...
10 years, 7 months ago (2013-09-13 02:35:31 UTC) #2
wallyworld
https://codereview.appspot.com/13274045/diff/1/environs/tools/simplestreams.go File environs/tools/simplestreams.go (right): https://codereview.appspot.com/13274045/diff/1/environs/tools/simplestreams.go#newcode186 environs/tools/simplestreams.go:186: func WriteMetadata(toolsList coretools.List, fetch bool, stor environs.Storage) error { ...
10 years, 7 months ago (2013-09-13 02:41:01 UTC) #3
axw1
10 years, 7 months ago (2013-09-13 03:28:09 UTC) #4
On 2013/09/13 02:41:01, wallyworld wrote:
>
https://codereview.appspot.com/13274045/diff/1/environs/tools/simplestreams.g...
> environs/tools/simplestreams.go:194: existingMetadata, err :=
> Fetch([]simplestreams.DataSource{dataSource}, simplestreams.DefaultIndexPath,
> toolsConstraint, false)
> On 2013/09/13 02:35:31, thumper wrote:
> > I really hate boolean parameters. There is nothing in this context that
tells
> me
> > what "false" means.
> 
> Yep. Too bad Go doesn't have named parameters.

An alternative is:

type FetchFlag bool

const (
    NoFetch FetchFlag = false
    Fetch FetchFlag = true
)
Sign in to reply to this message.

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