Merge lp:~axwalk/juju-core/lp1235716-sshstorage-sudo-prompt into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andrew Wilkins | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1973 | ||||
Proposed branch: | lp:~axwalk/juju-core/lp1235716-sshstorage-sudo-prompt | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
30 lines (+6/-3) 2 files modified
environs/sshstorage/storage.go (+5/-2) environs/sshstorage/storage_test.go (+1/-1) |
||||
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1235716-sshstorage-sudo-prompt | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email:
|
Commit message
environs/
Connect sudo command's stdout to os.Stdout,
and capture stderr in a bytes.Buffer. This
allows sudo prompts to be presented, while
still capturing "install" errors.
Fixes #1235716
Description of the change
environs/
Connect sudo command's stdout to os.Stdout,
and capture stderr in a bytes.Buffer. This
allows sudo prompts to be presented, while
still capturing "install" errors.
Fixes #1235716
To post a comment you must log in.
Reviewers: mp+189526_ code.launchpad. net,
Message:
Please take a look.
Description: sshstorage: don't hide sudo prompt
environs/
Connect sudo command's stdout to os.Stdout,
and capture stderr in a bytes.Buffer. This
allows sudo prompts to be presented, while
still capturing "install" errors.
Fixes #1235716
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1235716- sshstorage- sudo-prompt/ +merge/ 189526
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14461044/
Affected files (+8, -3 lines): sshstorage/ storage. go sshstorage/ storage_ test.go
A [revision details]
M environs/
M environs/
Index: [revision details] 20131004160159- i9eoormyw24etfr 4
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: environs/ sshstorage/ storage. go sshstorage/ storage. go' sshstorage/ storage. go 2013-10-03 08:34:41 +0000 sshstorage/ storage. go 2013-10-07 03:40:52 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -84,8 +84,11 @@
cmd := sshCommand(host, true, fmt.Sprintf("sudo bash -c %s", script) )) put(); err != nil { TrimSpace( string( out))) TrimSpace( stderr. String( )))
utils.ShQuote(
cmd.Stdin = os.Stdin
- if out, err := cmd.CombinedOut
- err = fmt.Errorf("failed to create storage dir: %v (%v)", err,
strings.
+ cmd.Stdout = os.Stdout // for sudo prompts/output
+ var stderr bytes.Buffer
+ cmd.Stderr = &stderr
+ if err := cmd.Run(); err != nil {
+ err = fmt.Errorf("failed to create storage dir: %v (%v)", err,
strings.
return nil, err
}
Index: environs/ sshstorage/ storage_ test.go sshstorage/ storage_ test.go' sshstorage/ storage_ test.go 2013-10-03 08:44:30 +0000 sshstorage/ storage_ test.go 2013-10-07 03:40:52 +0000 "bash", "-c", "echo alles gut") "true")
=== modified file 'environs/
--- environs/
+++ environs/
@@ -162,7 +162,7 @@
invocations++
switch invocations {
case 1, 3:
- return exec.Command(
+ return exec.Command(
case 2:
// Note: must close stdin before responding the first time, or
// the second command will race with closing stdin, and may