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

Issue 78030044: Implement a helper function for sudo.

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 8 months ago by thumper
Modified:
7 years, 8 months ago
Reviewers:
mp+211849, wallyworld
Visibility:
Public.

Description

Implement a helper function for sudo. Most of the local plugin helper commands will need to run as sudo. Instead of each writing their own code to handle this, provide a helper function. https://code.launchpad.net/~thumper/juju-core/local-ensure-root/+merge/211849 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -4 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/plugins/local/export_test.go View 1 chunk +8 lines, -1 line 0 comments Download
M cmd/plugins/local/main.go View 2 chunks +30 lines, -0 lines 1 comment Download
M cmd/plugins/local/main_test.go View 3 chunks +39 lines, -3 lines 0 comments Download

Messages

Total messages: 2
thumper
Please take a look.
7 years, 8 months ago (2014-03-20 02:04:37 UTC) #1
wallyworld
7 years, 8 months ago (2014-03-20 03:11:28 UTC) #2
LGTM with suggestion considered

https://codereview.appspot.com/78030044/diff/1/cmd/plugins/local/main.go
File cmd/plugins/local/main.go (right):

https://codereview.appspot.com/78030044/diff/1/cmd/plugins/local/main.go#newc...
cmd/plugins/local/main.go:48: func ensureRoot(args []string, context
*cmd.Context, call func(*cmd.Context) error) error {
Even though not exported, a doc comment would be nice. Maybe include that args
contains cmd to run in args[0] etc. I think I'd prefer args split up so that
command is passed in explicitly

func ensureRoot(cmd string, cmdArgs []string, context *cmd.Context, call
func(*cmd.Context) error {
}

And maybe call the method runAsRoot()
Sign in to reply to this message.

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