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

Issue 58510044: Fix various bootstrap issues (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by wallyworld
Modified:
10 years, 2 months ago
Reviewers:
axw, mp+203879, rog
Visibility:
Public.

Description

Fix various bootstrap issues This fixed bootstrap on MAAS with --upload-tools and also general bootstrap with --metadata-source. It also changes dummy storage so that it mimics MAAS behaviour to hopefully help catch future issues. https://code.launchpad.net/~wallyworld/juju-core/bootstrap-issues/+merge/203879 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -27 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/bootstrap.go View 4 chunks +13 lines, -2 lines 2 comments Download
M cmd/juju/bootstrap_test.go View 1 chunk +1 line, -0 lines 0 comments Download
M cmd/plugins/juju-metadata/imagemetadata.go View 1 chunk +4 lines, -0 lines 2 comments Download
M cmd/plugins/juju-metadata/signmetadata.go View 1 chunk +4 lines, -0 lines 1 comment Download
M cmd/plugins/juju-metadata/toolsmetadata_test.go View 5 chunks +5 lines, -5 lines 0 comments Download
M environs/imagemetadata/urls_test.go View 2 chunks +7 lines, -0 lines 0 comments Download
M environs/sync/sync.go View 5 chunks +7 lines, -8 lines 1 comment Download
M environs/sync/sync_test.go View 1 chunk +6 lines, -0 lines 0 comments Download
M environs/tools/simplestreams.go View 1 chunk +0 lines, -1 line 1 comment Download
M environs/tools/simplestreams_test.go View 4 chunks +6 lines, -4 lines 0 comments Download
M environs/tools/testing/testing.go View 4 chunks +21 lines, -6 lines 0 comments Download
M environs/tools/tools_test.go View 1 chunk +7 lines, -1 line 2 comments Download
M provider/dummy/storage.go View 1 chunk +14 lines, -0 lines 1 comment Download

Messages

Total messages: 4
wallyworld
Please take a look.
10 years, 2 months ago (2014-01-30 06:24:10 UTC) #1
axw
LGTM https://codereview.appspot.com/58510044/diff/1/cmd/plugins/juju-metadata/imagemetadata.go File cmd/plugins/juju-metadata/imagemetadata.go (right): https://codereview.appspot.com/58510044/diff/1/cmd/plugins/juju-metadata/imagemetadata.go#newcode170 cmd/plugins/juju-metadata/imagemetadata.go:170: dir, err = filepath.Abs(dir) Not really necessary is ...
10 years, 2 months ago (2014-01-30 07:07:36 UTC) #2
wallyworld
https://codereview.appspot.com/58510044/diff/1/environs/tools/tools_test.go File environs/tools/tools_test.go (right): https://codereview.appspot.com/58510044/diff/1/environs/tools/tools_test.go#newcode124 environs/tools/tools_test.go:124: err = stor.Put(filename, bytes.NewReader([]byte("dummy")), 5) On 2014/01/30 07:07:36, axw ...
10 years, 2 months ago (2014-01-30 07:37:50 UTC) #3
rog
10 years, 2 months ago (2014-01-30 09:46:49 UTC) #4
I'd like it if some of the issues below could be
addressed.

https://codereview.appspot.com/58510044/diff/1/cmd/juju/bootstrap.go
File cmd/juju/bootstrap.go (right):

https://codereview.appspot.com/58510044/diff/1/cmd/juju/bootstrap.go#newcode89
cmd/juju/bootstrap.go:89: c.MetadataSource, err =
utils.NormalizePath(c.MetadataSource)
This is wrong. It is the shell's responsibility to expand ~ and $ before calling
the program - we should not do it here.

https://codereview.appspot.com/58510044/diff/1/cmd/juju/bootstrap.go#newcode93
cmd/juju/bootstrap.go:93: c.MetadataSource, err = filepath.Abs(c.MetadataSource)
I believe this is wrong too - the path should be treated relatively to the
Context.Dir passed into Run (i.e. we should use filepath.Rel(ctx.Dir,
c.MetadataSource))

It's possible that we want to normalize ctx.Dir before that.

https://codereview.appspot.com/58510044/diff/1/cmd/plugins/juju-metadata/imag...
File cmd/plugins/juju-metadata/imagemetadata.go (right):

https://codereview.appspot.com/58510044/diff/1/cmd/plugins/juju-metadata/imag...
cmd/plugins/juju-metadata/imagemetadata.go:170: dir, err = filepath.Abs(dir)
filepath.Rel(context.Dir, dir)

Perhaps consider defining a method on Context to return an absolute path
relative to the context's directory.

Actually, it seems there is one. Please use c.AbsPath, changing it to use
NormalizePath if necessary (I actually don't think it is - what code relies on
that behaviour?)

https://codereview.appspot.com/58510044/diff/1/cmd/plugins/juju-metadata/sign...
File cmd/plugins/juju-metadata/signmetadata.go (right):

https://codereview.appspot.com/58510044/diff/1/cmd/plugins/juju-metadata/sign...
cmd/plugins/juju-metadata/signmetadata.go:71: c.dir, err = filepath.Abs(c.dir)
See earlier comment.

https://codereview.appspot.com/58510044/diff/1/environs/sync/sync.go
File environs/sync/sync.go (left):

https://codereview.appspot.com/58510044/diff/1/environs/sync/sync.go#oldcode245
environs/sync/sync.go:245: URL:     url,
How does the URL get into the metadata now?

https://codereview.appspot.com/58510044/diff/1/environs/tools/simplestreams.go
File environs/tools/simplestreams.go (left):

https://codereview.appspot.com/58510044/diff/1/environs/tools/simplestreams.g...
environs/tools/simplestreams.go:247: FullPath: t.URL,
Why are we ignoring the tools URL here now?

If nothing else, the doc comment on MetadataFromTools should
mention it.

https://codereview.appspot.com/58510044/diff/1/provider/dummy/storage.go
File provider/dummy/storage.go (right):

https://codereview.appspot.com/58510044/diff/1/provider/dummy/storage.go#newc...
provider/dummy/storage.go:132: found := true
This should be false.
Otherwise we'll return true when there are no files at all.
Sign in to reply to this message.

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