Add IP address to scan results (#602)

This commit is contained in:
Teppei Fukuda
2018-02-19 12:50:00 +09:00
committed by Kota Kanbe
parent 562ff7807d
commit 7a5793c562
12 changed files with 239 additions and 2 deletions

View File

@@ -44,6 +44,8 @@ type osTypeInterface interface {
checkDependencies() error
checkIfSudoNoPasswd() error
preCure() error
postScan() error
scanPackages() error
convertToModel() models.ScanResult
@@ -454,8 +456,14 @@ func setupChangelogCache() error {
func scanVulns(jsonDir string, scannedAt time.Time, timeoutSec int) error {
var results models.ScanResults
parallelExec(func(o osTypeInterface) error {
return o.scanPackages()
parallelExec(func(o osTypeInterface) (err error) {
if err = o.preCure(); err != nil {
return err
}
if err = o.scanPackages(); err != nil {
return err
}
return o.postScan()
}, timeoutSec)
for _, s := range append(servers, errServers...) {