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

Side by Side Diff: utils/ssh/ssh.go

Issue 70770043: all: use errgo instead of fmt.Errorf
Patch Set: all: use errgo instead of fmt.Errorf Created 11 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « utils/ssh/run.go ('k') | utils/ssh/ssh_gocrypto.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 // Package ssh contains utilities for dealing with SSH connections, 4 // Package ssh contains utilities for dealing with SSH connections,
5 // key management, and so on. All SSH-based command executions in 5 // key management, and so on. All SSH-based command executions in
6 // Juju should use the Command/ScpCommand functions in this package. 6 // Juju should use the Command/ScpCommand functions in this package.
7 // 7 //
8 package ssh 8 package ssh
9 9
10 import ( 10 import (
11 "bytes" 11 "bytes"
12 "errors"
13 "io" 12 "io"
14 "os/exec" 13 "os/exec"
15 "syscall" 14 "syscall"
16 15
16 "github.com/juju/errgo/errors"
17
17 "launchpad.net/juju-core/cmd" 18 "launchpad.net/juju-core/cmd"
18 ) 19 )
19 20
20 // Options is a client-implementation independent SSH options set. 21 // Options is a client-implementation independent SSH options set.
21 type Options struct { 22 type Options struct {
22 // ssh server port; zero means use the default (22) 23 // ssh server port; zero means use the default (22)
23 port int 24 port int
24 // no PTY forced by default 25 // no PTY forced by default
25 allocatePTY bool 26 allocatePTY bool
26 // password authentication is disallowed by default 27 // password authentication is disallowed by default
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 func Command(host string, command []string, options *Options) *Cmd { 226 func Command(host string, command []string, options *Options) *Cmd {
226 logger.Debugf("using %s ssh client", chosenClient) 227 logger.Debugf("using %s ssh client", chosenClient)
227 return DefaultClient.Command(host, command, options) 228 return DefaultClient.Command(host, command, options)
228 } 229 }
229 230
230 // Copy is a short-cut for DefaultClient.Copy. 231 // Copy is a short-cut for DefaultClient.Copy.
231 func Copy(targets, extraArgs []string, options *Options) error { 232 func Copy(targets, extraArgs []string, options *Options) error {
232 logger.Debugf("using %s ssh client", chosenClient) 233 logger.Debugf("using %s ssh client", chosenClient)
233 return DefaultClient.Copy(targets, extraArgs, options) 234 return DefaultClient.Copy(targets, extraArgs, options)
234 } 235 }
OLDNEW
« no previous file with comments | « utils/ssh/run.go ('k') | utils/ssh/ssh_gocrypto.go » ('j') | no next file with comments »

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