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

Issue 5901058: cmd/juju: working bootstrap and destroy commands

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by rog
Modified:
12 years ago
Reviewers:
mp+99288, niemeyer, TheMue
Visibility:
Public.

Description

cmd/juju: working bootstrap and destroy commands https://code.launchpad.net/~rogpeppe/juju/go-more-commands/+merge/99288 Requires: https://code.launchpad.net/~rogpeppe/juju/go-testing-environs/+merge/99050 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : cmd/juju: working bootstrap and destroy commands #

Patch Set 3 : cmd/juju: working bootstrap and destroy commands #

Patch Set 4 : cmd/juju: working bootstrap and destroy commands #

Total comments: 4

Patch Set 5 : cmd/juju: working bootstrap and destroy commands #

Total comments: 5

Patch Set 6 : cmd/juju: working bootstrap and destroy commands #

Patch Set 7 : cmd/juju: working bootstrap and destroy commands #

Patch Set 8 : cmd/juju: working bootstrap and destroy commands #

Patch Set 9 : cmd/juju: working bootstrap and destroy commands #

Patch Set 10 : cmd/juju: working bootstrap and destroy commands #

Total comments: 2

Patch Set 11 : cmd/juju: working bootstrap and destroy commands #

Patch Set 12 : cmd/juju: working bootstrap and destroy commands #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3377 lines, -419 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/command.go View 1 2 3 4 5 6 7 8 9 10 3 chunks +12 lines, -65 lines 0 comments Download
A cmd/context.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +107 lines, -0 lines 0 comments Download
A cmd/context_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +141 lines, -0 lines 0 comments Download
M cmd/juju/bootstrap.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +22 lines, -22 lines 0 comments Download
M cmd/juju/cmd_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +171 lines, -21 lines 0 comments Download
A cmd/juju/destroy.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +42 lines, -0 lines 0 comments Download
M cmd/juju/main.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -3 lines 0 comments Download
M cmd/juju/main_test.go View 1 2 3 4 5 6 7 8 9 10 4 chunks +51 lines, -2 lines 0 comments Download
M cmd/jujud/agent.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -9 lines 0 comments Download
M cmd/jujud/initzk.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -10 lines 0 comments Download
M cmd/jujud/initzk_test.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -9 lines 0 comments Download
M cmd/jujud/machine.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -10 lines 0 comments Download
M cmd/jujud/main.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -6 lines 0 comments Download
M cmd/jujud/main_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/provisioning.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -2 lines 0 comments Download
M cmd/jujud/unit.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -10 lines 0 comments Download
M cmd/jujud/util_test.go View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -5 lines 0 comments Download
M cmd/supercommand.go View 1 2 3 4 5 6 7 8 9 10 4 chunks +32 lines, -79 lines 0 comments Download
M cmd/supercommand_test.go View 1 2 3 4 5 6 7 8 9 10 4 chunks +39 lines, -42 lines 0 comments Download
M environs/dummy/environs.go View 1 2 3 4 5 6 7 8 9 10 14 chunks +86 lines, -13 lines 0 comments Download
M environs/ec2/cloudinit.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M environs/ec2/ec2.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -9 lines 0 comments Download
M environs/ec2/live_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M environs/ec2/local_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M juju/conn.go View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -5 lines 0 comments Download
M state/open.go View 1 2 3 4 5 6 7 8 9 10 3 chunks +35 lines, -11 lines 0 comments Download
M state/service.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download
A state/ssh.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +282 lines, -0 lines 0 comments Download
A state/ssh_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +494 lines, -0 lines 0 comments Download
A state/sshtest/authorized_keys View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
A state/sshtest/id_rsa View 1 2 3 4 5 6 7 8 9 10 1 chunk +27 lines, -0 lines 0 comments Download
A state/sshtest/id_rsa.pub View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
A state/sshtest/sshd_config View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M state/state.go View 1 2 3 4 5 6 7 8 9 10 3 chunks +76 lines, -1 line 0 comments Download
M state/unit.go View 1 2 3 4 5 6 7 8 9 10 6 chunks +177 lines, -5 lines 0 comments Download
M state/util.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +13 lines, -0 lines 0 comments Download
A state/watch_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +175 lines, -0 lines 0 comments Download
A state/watcher/watcher.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +255 lines, -0 lines 0 comments Download
A state/watcher/watcher_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +168 lines, -0 lines 0 comments Download
A store/charmd/config.yaml View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M store/charmd/main.go View 1 2 3 4 5 6 7 8 9 10 3 chunks +41 lines, -7 lines 0 comments Download
A store/charmload/config.yaml View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M store/charmload/main.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +41 lines, -4 lines 0 comments Download
M store/server.go View 1 2 3 4 5 6 7 8 9 10 6 chunks +97 lines, -6 lines 0 comments Download
M store/server_test.go View 1 2 3 4 5 6 7 8 9 10 3 chunks +164 lines, -48 lines 0 comments Download
M store/store.go View 1 2 3 4 5 6 7 8 9 10 13 chunks +196 lines, -3 lines 0 comments Download
M store/store_test.go View 1 2 3 4 5 6 7 8 9 10 4 chunks +134 lines, -1 line 0 comments Download
M testing/zk.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -6 lines 0 comments Download
A version/version.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +89 lines, -0 lines 0 comments Download
A version/version_test.go View 1 2 3 4 5 6 7 8 9 10 1 chunk +103 lines, -0 lines 0 comments Download

Messages

Total messages: 9
rog
Please take a look.
12 years, 1 month ago (2012-03-26 11:52:14 UTC) #1
TheMue
Two small comments. https://codereview.appspot.com/5901058/diff/1011/cmd/command.go File cmd/command.go (right): https://codereview.appspot.com/5901058/diff/1011/cmd/command.go#newcode62 cmd/command.go:62: // PrintUsage prints usage information for ...
12 years, 1 month ago (2012-03-26 12:02:16 UTC) #2
rog
Please take a look. https://codereview.appspot.com/5901058/diff/1011/cmd/command.go File cmd/command.go (right): https://codereview.appspot.com/5901058/diff/1011/cmd/command.go#newcode62 cmd/command.go:62: // PrintUsage prints usage information ...
12 years, 1 month ago (2012-03-26 12:28:36 UTC) #3
TheMue
LGTM
12 years, 1 month ago (2012-03-26 12:30:29 UTC) #4
niemeyer
Looks quite nice. https://codereview.appspot.com/5901058/diff/4001/cmd/command.go File cmd/command.go (right): https://codereview.appspot.com/5901058/diff/4001/cmd/command.go#newcode41 cmd/command.go:41: // InitFlagSet prepares a FlagSet such ...
12 years, 1 month ago (2012-03-26 23:10:48 UTC) #5
rog
Please take a look.
12 years, 1 month ago (2012-03-27 14:14:05 UTC) #6
rog
Please take a look.
12 years, 1 month ago (2012-03-27 14:14:55 UTC) #7
rog
Please take a look. https://codereview.appspot.com/5901058/diff/4001/cmd/command.go File cmd/command.go (right): https://codereview.appspot.com/5901058/diff/4001/cmd/command.go#newcode41 cmd/command.go:41: // InitFlagSet prepares a FlagSet ...
12 years, 1 month ago (2012-03-28 16:38:28 UTC) #8
niemeyer
12 years ago (2012-04-11 01:06:24 UTC) #9
LGTM, but I suggest cleaning those tests.

https://codereview.appspot.com/5901058/diff/13013/cmd/juju/cmd_test.go
File cmd/juju/cmd_test.go (right):

https://codereview.appspot.com/5901058/diff/13013/cmd/juju/cmd_test.go#newcod...
cmd/juju/cmd_test.go:153: c.Assert(err, ErrorMatches, t.parseErr)
s/parseErr/runErr/?

The amount of generality in this file feels a bit over the top, by the way.
There's a lot of unused fields and logic, and several helpers with reflection
and whatnot, and the actual tests being done are trivial. I'd prefer to go
towards a more trivial testing approach that can actually be read and reasoned
about, than tables full of flags and magic as we have here. It's fine to leave
non-existent tests out of the logic entirely.

https://codereview.appspot.com/5901058/diff/13013/environs/dummy/environs.go
File environs/dummy/environs.go (right):

https://codereview.appspot.com/5901058/diff/13013/environs/dummy/environs.go#...
environs/dummy/environs.go:125: "broken": schema.Bool(),
gofmt
Sign in to reply to this message.

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