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

Issue 12019043: Support juju debug-hooks (Closed)

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

Description

Support juju debug-hooks This implementation is a departure from pyjuju, as we do not have Zookeeper's ephemeral nodes to rely upon for locking. The approach taken is described here: https://bugs.launchpad.net/juju-core/+bug/1027876/comments/11 Rather than periodically checking tmux, I've just gone for a simple approach of calling "tmux has-session" each time a hook is to be executed. If this proves to be too expensive, then reassess. https://code.launchpad.net/~axwalk/juju-core/lp1027876-implement-debug-hooks/+merge/177353 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Support juju debug-hooks #

Total comments: 40

Patch Set 3 : Support juju debug-hooks #

Total comments: 16

Patch Set 4 : Support juju debug-hooks #

Patch Set 5 : Support juju debug-hooks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+783 lines, -26 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A cmd/juju/debughooks.go View 1 2 3 4 1 chunk +106 lines, -0 lines 0 comments Download
A cmd/juju/debughooks_test.go View 1 2 3 4 1 chunk +89 lines, -0 lines 0 comments Download
M cmd/juju/main.go View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M cmd/juju/main_test.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M cmd/juju/scp.go View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M cmd/juju/ssh.go View 1 2 3 chunks +16 lines, -6 lines 0 comments Download
M worker/uniter/context.go View 1 2 3 chunks +31 lines, -17 lines 0 comments Download
A worker/uniter/debug/client.go View 1 2 1 chunk +120 lines, -0 lines 0 comments Download
A worker/uniter/debug/client_test.go View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
A worker/uniter/debug/common.go View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
A worker/uniter/debug/common_test.go View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
A worker/uniter/debug/server.go View 1 2 1 chunk +114 lines, -0 lines 0 comments Download
A worker/uniter/debug/server_test.go View 1 2 1 chunk +189 lines, -0 lines 0 comments Download

Messages

Total messages: 11
axw
Please take a look.
10 years, 9 months ago (2013-07-30 07:14:13 UTC) #1
fwereade
Thanks, this is looking really nice; I have a number of thoughts below, of varying ...
10 years, 9 months ago (2013-07-31 02:02:07 UTC) #2
axw
Please take a look.
10 years, 9 months ago (2013-07-31 06:03:03 UTC) #3
axw1
https://codereview.appspot.com/12019043/diff/3001/cmd/juju/debughooks.go File cmd/juju/debughooks.go (right): https://codereview.appspot.com/12019043/diff/3001/cmd/juju/debughooks.go#newcode79 cmd/juju/debughooks.go:79: return fmt.Errorf("unit %q does not contain hook %q", unit.Name(), ...
10 years, 9 months ago (2013-07-31 06:04:23 UTC) #4
wallyworld
LGTM, but I am not at all familiar with Juju's debug hooks. Not sure if ...
10 years, 9 months ago (2013-08-02 00:09:17 UTC) #5
axw
Please take a look.
10 years, 9 months ago (2013-08-02 01:11:54 UTC) #6
axw1
https://codereview.appspot.com/12019043/diff/20001/cmd/juju/debughooks_test.go File cmd/juju/debughooks_test.go (right): https://codereview.appspot.com/12019043/diff/20001/cmd/juju/debughooks_test.go#newcode14 cmd/juju/debughooks_test.go:14: "regexp" On 2013/08/02 00:09:17, wallyworld wrote: > Please group ...
10 years, 9 months ago (2013-08-02 01:12:52 UTC) #7
fwereade
LGTM, just a couple of trivials. https://codereview.appspot.com/12019043/diff/20001/cmd/juju/debughooks.go File cmd/juju/debughooks.go (right): https://codereview.appspot.com/12019043/diff/20001/cmd/juju/debughooks.go#newcode102 cmd/juju/debughooks.go:102: args := []string{"--", ...
10 years, 9 months ago (2013-08-02 09:31:30 UTC) #8
axw1
https://codereview.appspot.com/12019043/diff/20001/cmd/juju/debughooks.go File cmd/juju/debughooks.go (right): https://codereview.appspot.com/12019043/diff/20001/cmd/juju/debughooks.go#newcode102 cmd/juju/debughooks.go:102: args := []string{"--", fmt.Sprintf("sudo /bin/bash -c '%s'", fmt.Sprintf(`F=$(mktemp); echo ...
10 years, 9 months ago (2013-08-02 10:06:25 UTC) #9
axw
Please take a look.
10 years, 9 months ago (2013-08-02 10:08:26 UTC) #10
fwereade
10 years, 9 months ago (2013-08-02 10:56:28 UTC) #11
LGTM, thanks.

https://codereview.appspot.com/12019043/diff/20001/cmd/juju/ssh.go
File cmd/juju/ssh.go (right):

https://codereview.appspot.com/12019043/diff/20001/cmd/juju/ssh.go#newcode84
cmd/juju/ssh.go:84: c.Conn, err = juju.NewConnFromName(c.EnvName)
On 2013/08/02 10:06:26, axw1 wrote:
> On 2013/08/02 09:31:30, fwereade wrote:
> > If we're doing this, how about adding it to EnvCommandBase instead? Almost
> every
> > command that uses an env also needs to do this.
> 
> I don't think that it's particularly valuable. SSHCommand is special, because
> it's reusing the Conn field initialised by an enclosing command.
> 
> The reason for the initConn method is to document whose responsibility it is
to
> close the connection, and make people aware that the conn is stored and
reused.

Fair enough, SGTM.
Sign in to reply to this message.

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