Add error handling when unable to connect via ssh. status code: 255

This commit is contained in:
kota kanbe
2016-06-26 08:09:54 +09:00
parent 8aff1af939
commit d3466eabe5
2 changed files with 21 additions and 7 deletions

View File

@@ -108,10 +108,18 @@ func (s CvePacksList) Less(i, j int) bool {
func detectOS(c config.ServerInfo) (osType osTypeInterface) {
var itsMe bool
if itsMe, osType = detectDebian(c); itsMe {
var fatalErr error
itsMe, osType, fatalErr = detectDebian(c)
if fatalErr != nil {
osType.setServerInfo(c)
osType.setErrs([]error{fatalErr})
return
} else if itsMe {
Log.Debugf("Debian like Linux. Host: %s:%s", c.Host, c.Port)
return
}
if itsMe, osType = detectRedhat(c); itsMe {
Log.Debugf("Redhat like Linux. Host: %s:%s", c.Host, c.Port)
return