(sh models.Shell)
| 121 | } |
| 122 | |
| 123 | func findSessionFor(sh models.Shell) (err error, sess session.Session) { |
| 124 | // first try one of the default handlers |
| 125 | if err, sess = session.For(sh, timeouts); sess == nil && err == nil { |
| 126 | // try one of the user plugins |
| 127 | if plugin := plugins.Get(sh); plugin != nil { |
| 128 | err, sess = plugin.NewSession(sh, timeouts) |
| 129 | } |
| 130 | } |
| 131 | // no error but no session found? |
| 132 | if err == nil && sess == nil { |
| 133 | err = fmt.Errorf("session type %s for shell %s is not supported", sh.Type, sh.Name) |
| 134 | } |
| 135 | return |
| 136 | } |
| 137 | |
| 138 | func cmdWorker(job async.Job) { |
| 139 | shell := job.(models.Shell) |
no test coverage detected