Was needed as part of this branch as Putting from a file into storage,
which has a Close method, caused the Seek(0,0) as the localstorage used
http.NewRequest, which had the side effect of closing the file.
I've added a test now to confirm that Close isn't called.
https://codereview.appspot.com/11326043/diff/1/environs/tools/build.go#newcode212
environs/tools/build.go:212: if err := copyExistingJujud(dir); err !=
nil {
On 2013/07/16 11:21:33, fwereade wrote:
> Actually, this has percolated a bit and I'm not so happy. This is
quite a big
> and magical behaviour change... I have on a few occasions
needed/wanted to
> upload tools that *don't* match the juju binary I'm using, and this
kinda breaks
> that. Can still be worked around; and should probably only affect
developers;
> but I'm starting to think that it's wrong to piggyback on the
upload-tools
> mechanism for this use case.
> I should be around tonight to talk about it a little... my big concern
is that
> we're changing behavior that *will* affect all the users who are using
> upload-tools. Maybe I can be convinced that it's only a little, and
maybe even a
> beneficial, change; but let's discuss tonight.
https://codereview.appspot.com/11326043/diff/1/environs/tools/storage.go#newcode49
environs/tools/storage.go:49: logger.Debugf("reading v%d.* tools",
majorVersion)
On 2013/07/16 09:43:00, gz wrote:
> Having logger declared in build.go and used without import in
storage.go is
> slightly confusing. I will get my head around the go package model at
some
> point.
Yeah. I'd really prefer the ability to have file local variables, but
go doesn't do that.
Working on writing extra tests now.
https:/ /codereview. appspot. com/11326043/ diff/1/ environs/ localstorage/ storage. go localstorage/ storage. go (right):
File environs/
https:/ /codereview. appspot. com/11326043/ diff/1/ environs/ localstorage/ storage. go#newcode95 localstorage/ storage. go:95: // struct so the Close method is
environs/
not exposed.
On 2013/07/16 11:09:50, fwereade wrote:
> On 2013/07/16 09:43:00, gz wrote:
> > Unrelated drive-by? Kind of thing I'd like a failing test for.
> +1
Was needed as part of this branch as Putting from a file into storage,
which has a Close method, caused the Seek(0,0) as the localstorage used
http.NewRequest, which had the side effect of closing the file.
I've added a test now to confirm that Close isn't called.
https:/ /codereview. appspot. com/11326043/ diff/1/ environs/ tools/build. go tools/build. go (right):
File environs/
https:/ /codereview. appspot. com/11326043/ diff/1/ environs/ tools/build. go#newcode131 tools/build. go:131: if info.Mode()&0111 != 0 {
environs/
On 2013/07/16 11:09:50, fwereade wrote:
> On 2013/07/16 09:43:00, gz wrote:
> > I like spaces even around bitops.
> I think go fmt decides that for you.
I like spaces too, but go fmt doesn't.
https:/ /codereview. appspot. com/11326043/ diff/1/ environs/ tools/build. go#newcode212 tools/build. go:212: if err := copyExistingJuj ud(dir) ; err !=
environs/
nil {
On 2013/07/16 11:21:33, fwereade wrote:
> Actually, this has percolated a bit and I'm not so happy. This is
quite a big
> and magical behaviour change... I have on a few occasions
needed/wanted to
> upload tools that *don't* match the juju binary I'm using, and this
kinda breaks
> that. Can still be worked around; and should probably only affect
developers;
> but I'm starting to think that it's wrong to piggyback on the
upload-tools
> mechanism for this use case.
> I should be around tonight to talk about it a little... my big concern
is that
> we're changing behavior that *will* affect all the users who are using
> upload-tools. Maybe I can be convinced that it's only a little, and
maybe even a
> beneficial, change; but let's discuss tonight.
As discussed, we'll go with this for now.
https:/ /codereview. appspot. com/11326043/ diff/1/ environs/ tools/storage. go tools/storage. go (right):
File environs/
https:/ /codereview. appspot. com/11326043/ diff/1/ environs/ tools/storage. go#newcode49 tools/storage. go:49: logger. Debugf( "reading v%d.* tools",
environs/
majorVersion)
On 2013/07/16 09:43:00, gz wrote:
> Having logger declared in build.go and used without import in
storage.go is
> slightly confusing. I will get my head around the go package model at
some
> point.
Yeah. I'd really prefer the ability to have file local variables, but
go doesn't do that.
https:/ /codereview. appspot. com/11326043/