From 1cfd7e26f255243678d0069dbc8e4b9012bef960 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Tue, 5 Mar 2019 10:20:23 +0800 Subject: [PATCH] fix: isActive error message include filename --- pkg/image/models/images.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/image/models/images.go b/pkg/image/models/images.go index 9cfc365dee..e458df9cf3 100644 --- a/pkg/image/models/images.go +++ b/pkg/image/models/images.go @@ -954,31 +954,31 @@ func (manager *SImageManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQ func isActive(localPath string, size int64, chksum string, fastHash string, useFastHash bool) bool { if len(localPath) == 0 || !fileutils2.Exists(localPath) { - log.Errorf("invalid file") + log.Errorf("invalid file: %s", localPath) return false } if size != fileutils2.FileSize(localPath) { - log.Errorf("size mistmatch") + log.Errorf("size mistmatch: %s", localPath) return false } if useFastHash && len(fastHash) > 0 { fhash, err := fileutils2.FastCheckSum(localPath) if err != nil { - log.Errorf("IsActive fastChecksum fail %s", err) + log.Errorf("IsActive fastChecksum fail %s for %s", err, localPath) return false } if fastHash != fhash { - log.Errorf("IsActive fastChecksum mismatch") + log.Errorf("IsActive fastChecksum mismatch for %s", localPath) return false } } else { md5sum, err := fileutils2.MD5(localPath) if err != nil { - log.Errorf("IsActive md5 fail %s", err) + log.Errorf("IsActive md5 fail %s for %s", err, localPath) return false } if chksum != md5sum { - log.Errorf("IsActive checksum mismatch") + log.Errorf("IsActive checksum mismatch: %s", localPath) return false } }