cmd/juju: add --upload-tools flag to bootstrap command
Also add Storage API to environs.Environ interface.
https://code.launchpad.net/~rogpeppe/juju/go-upload-tools-flag/+merge/104257
(do not edit description out of merge proposal)
oops, forgot to publish these comments https://codereview.appspot.com/6145043/diff/7001/cmd/juju/cmd_test.go File cmd/juju/cmd_test.go (right): https://codereview.appspot.com/6145043/diff/7001/cmd/juju/cmd_test.go#newcode142 cmd/juju/cmd_test.go:142: c.Check(<-opc, Equals, op(dummy.OpPutFile, ...
12 years, 10 months ago
(2012-05-04 16:29:13 UTC)
#5
oops, forgot to publish these comments
https://codereview.appspot.com/6145043/diff/7001/cmd/juju/cmd_test.go
File cmd/juju/cmd_test.go (right):
https://codereview.appspot.com/6145043/diff/7001/cmd/juju/cmd_test.go#newcode142
cmd/juju/cmd_test.go:142: c.Check(<-opc, Equals, op(dummy.OpPutFile, "peckham"))
On 2012/05/03 00:52:05, niemeyer wrote:
> The mocking here is starting to feel really bad. This test is verifying that
> PutFile is called somewhen, somehow, for some reason. There are zero
guarantees
> that it is actually related to tools being uploaded. A much better test (and
> pretty simple) would be verifying that the dummy environment actually got the
> file uploaded.
Ok. I thought that since we test UploadTools in more detail elsewhere, we could
assume that the presence of PutFile means that UploadTools was invoked
correctly. I wanted to avoid duplicating the file name in one more place, but
perhaps I'd be better off defining it inside the version package. I'll do that,
and see what you think.
https://codereview.appspot.com/6145043/diff/7001/environs/jujutest/test.go
File environs/jujutest/test.go (right):
https://codereview.appspot.com/6145043/diff/7001/environs/jujutest/test.go#ne...
environs/jujutest/test.go:78: err := t.Env.Bootstrap(true)
On 2012/05/03 00:52:05, niemeyer wrote:
> Shouldn't this be false, at least for the moment while nothing is being done
> with the toolset?
ok, i'll leave it as a TODO.
This is looking nice, but we've had a conversation today about how to organize things ...
12 years, 10 months ago
(2012-05-15 20:18:29 UTC)
#7
This is looking nice, but we've had a conversation today about how to organize
things (GetTools/PutTools, Storage, etc) that should be reflected in it.
I'm marking it as WIP for organization. Please re-propose when it's ready for
another look.
Minor gripe with the new dummy API. If you're happy with the suggested change, the ...
12 years, 10 months ago
(2012-05-17 18:25:48 UTC)
#16
Minor gripe with the new dummy API. If you're happy with the suggested change,
the whole thing LGTM.
https://codereview.appspot.com/6145043/diff/25018/cmd/juju/cmd_test.go
File cmd/juju/cmd_test.go (right):
https://codereview.appspot.com/6145043/diff/25018/cmd/juju/cmd_test.go#newcod...
cmd/juju/cmd_test.go:123: defer dummy.Reset(nil, false)
> i've factored Reset into two operations - Listen and Close, which i think may
> work better.
This looks like a good direction, but the API feels a bit awkward. dummy.Listen
resets? dummy.Close closes what? Not the dummy env, since it continues working
just fine. Please see the comments in the dummy environment for a suggested
follow up.
https://codereview.appspot.com/6145043/diff/25018/environs/interface.go
File environs/interface.go (right):
https://codereview.appspot.com/6145043/diff/25018/environs/interface.go#newco...
environs/interface.go:62: // in alphabetical order.
On 2012/05/17 11:43:33, rog wrote:
> On 2012/05/17 01:08:42, niemeyer wrote:
> > This should also mention the behavior with "directories".
>
> i'm not sure what you mean here. there are no directories, and all behaviour
> here can be understood in terms of simple names, i believe.
The point is precisely to tell people what you believe, since what they believe
may not match what you believe. Let's please include this:
// The names in the storage are considered to be in a flat
// namespace, so the prefix may include slashes and what is
// returned is the full name for the matching entries.
https://codereview.appspot.com/6145043/diff/27003/cmd/juju/cmd_test.go
File cmd/juju/cmd_test.go (right):
https://codereview.appspot.com/6145043/diff/27003/cmd/juju/cmd_test.go#newcod...
cmd/juju/cmd_test.go:138: defer dummy.Listen(nil)
Is this needed, considering that TearDownTest does it too?
https://codereview.appspot.com/6145043/diff/27003/environs/dummy/environs.go
File environs/dummy/environs.go (right):
https://codereview.appspot.com/6145043/diff/27003/environs/dummy/environs.go#...
environs/dummy/environs.go:107: // cleaned without registering a channel.
As pointed out earlier, the direction seems good, but the details of how this is
working sounds more involved than necessary.
The following API would separate the two concepts apart, and clarify the call
sites:
// Reset resets the entire dummy environment and any
// registered operation listeners. All opened environments
// after Reset will share the same underlying state.
func Reset() {
// Listen closes the previously registered listener (if any),
// and if c is not nil registers it to receive notifications
// of follow up operations in the environment.
func Listen(c chan<- Operation) {
No need for dummy.Close. The dummy environment is not being closed.
*** Submitted: cmd/juju: add --upload-tools flag to bootstrap command Also add Storage API to environs.Environ ...
12 years, 10 months ago
(2012-05-18 11:22:18 UTC)
#17
*** Submitted:
cmd/juju: add --upload-tools flag to bootstrap command
Also add Storage API to environs.Environ interface.
R=fwereade, niemeyer
CC=
https://codereview.appspot.com/6145043https://codereview.appspot.com/6145043/diff/25018/environs/interface.go
File environs/interface.go (right):
https://codereview.appspot.com/6145043/diff/25018/environs/interface.go#newco...
environs/interface.go:62: // in alphabetical order.
On 2012/05/17 18:25:48, niemeyer wrote:
> On 2012/05/17 11:43:33, rog wrote:
> > On 2012/05/17 01:08:42, niemeyer wrote:
> > > This should also mention the behavior with "directories".
> >
> > i'm not sure what you mean here. there are no directories, and all behaviour
> > here can be understood in terms of simple names, i believe.
>
> The point is precisely to tell people what you believe, since what they
believe
> may not match what you believe. Let's please include this:
>
> // The names in the storage are considered to be in a flat
> // namespace, so the prefix may include slashes and what is
> // returned is the full name for the matching entries.
Done.
https://codereview.appspot.com/6145043/diff/27003/cmd/juju/cmd_test.go
File cmd/juju/cmd_test.go (right):
https://codereview.appspot.com/6145043/diff/27003/cmd/juju/cmd_test.go#newcod...
cmd/juju/cmd_test.go:138: defer dummy.Listen(nil)
On 2012/05/17 18:25:49, niemeyer wrote:
> Is this needed, considering that TearDownTest does it too?
Done.
https://codereview.appspot.com/6145043/diff/27003/environs/dummy/environs.go
File environs/dummy/environs.go (right):
https://codereview.appspot.com/6145043/diff/27003/environs/dummy/environs.go#...
environs/dummy/environs.go:107: // cleaned without registering a channel.
On 2012/05/17 18:25:49, niemeyer wrote:
> As pointed out earlier, the direction seems good, but the details of how this
is
> working sounds more involved than necessary.
>
> The following API would separate the two concepts apart, and clarify the call
> sites:
>
> // Reset resets the entire dummy environment and any
> // registered operation listeners. All opened environments
> // after Reset will share the same underlying state.
> func Reset() {
>
> // Listen closes the previously registered listener (if any),
> // and if c is not nil registers it to receive notifications
> // of follow up operations in the environment.
> func Listen(c chan<- Operation) {
>
>
> No need for dummy.Close. The dummy environment is not being closed.
that's definitely nicer, thanks. done.
Issue 6145043: cmd/juju: add --upload-tools flag to bootstrap command
Created 12 years, 11 months ago by rog
Modified 12 years, 10 months ago
Reviewers: mp+104257_code.launchpad.net
Base URL:
Comments: 61