|
@@ -7,6 +7,7 @@ import (
|
|
|
"log"
|
|
|
"os"
|
|
|
"path"
|
|
|
+ "strings"
|
|
|
|
|
|
"git.lattuga.net/blallo/papero/worker"
|
|
|
"github.com/mitchellh/go-homedir"
|
|
@@ -178,7 +179,11 @@ func validatePort(port int) (int, error) {
|
|
|
|
|
|
func getPassword(connection *connectionInfo) (string, error) {
|
|
|
if connection.PasswordExec.Present() {
|
|
|
- return connection.PasswordExec.Run()
|
|
|
+ pass, err := connection.PasswordExec.Run()
|
|
|
+ if err != nil {
|
|
|
+ return "", err
|
|
|
+ }
|
|
|
+ return strings.TrimRight(pass, "\n"), nil
|
|
|
}
|
|
|
if connection.PasswordFile != "" {
|
|
|
file, err := os.Open(connection.PasswordFile)
|