fix(report): enable to report when the sshkey not exist (#909)

This commit is contained in:
Kota Kanbe
2019-09-18 22:40:36 +09:00
committed by GitHub
parent d5a3e5c2c5
commit 76363c227b
5 changed files with 83 additions and 50 deletions

View File

@@ -1,7 +1,6 @@
package config
import (
"os"
"regexp"
"strings"
@@ -92,13 +91,6 @@ func (c TOMLLoader) Load(pathToToml, keyPass string) error {
if len(s.KeyPath) == 0 {
s.KeyPath = d.KeyPath
}
if s.KeyPath != "" {
if _, err := os.Stat(s.KeyPath); err != nil {
return xerrors.Errorf(
"%s is invalid. keypath: %s not exists", serverName, s.KeyPath)
}
}
s.KeyPassword = v.KeyPassword
if len(s.KeyPassword) == 0 {
s.KeyPassword = d.KeyPassword