From a3d6d6acfb3fed53967ae8c024ddc2b565bd284b Mon Sep 17 00:00:00 2001 From: koplas Date: Fri, 13 Dec 2024 14:26:00 +0100 Subject: [PATCH] Downgrade error to info in directory hash fetching --- cmd/csaf_checker/processor.go | 9 +++++++-- cmd/csaf_checker/processor_test.go | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/csaf_checker/processor.go b/cmd/csaf_checker/processor.go index 7972e2b..eed561a 100644 --- a/cmd/csaf_checker/processor.go +++ b/cmd/csaf_checker/processor.go @@ -776,8 +776,13 @@ func (p *processor) integrity( continue } if res.StatusCode != http.StatusOK { - p.badIntegrities.error("Fetching %s failed: Status code %d (%s)", - hashFile, res.StatusCode, res.Status) + if f.IsDirectory() { + p.badIntegrities.info("Fetching %s failed: Status code %d (%s)", + hashFile, res.StatusCode, res.Status) + } else { + p.badIntegrities.error("Fetching %s failed: Status code %d (%s)", + hashFile, res.StatusCode, res.Status) + } continue } h, err := func() ([]byte, error) { diff --git a/cmd/csaf_checker/processor_test.go b/cmd/csaf_checker/processor_test.go index c4fb532..ea5aed5 100644 --- a/cmd/csaf_checker/processor_test.go +++ b/cmd/csaf_checker/processor_test.go @@ -146,9 +146,9 @@ func TestShaMarking(t *testing.T) { EnableSha512: test.enableSha512, }, test.directoryProvider) - for i, want := range report.Domains[0].Requirements { - if !reflect.DeepEqual(expected[i], *want) { - t.Errorf("SHA marking %v: Expected %v, got %v", test.name, *want, expected[i]) + for i, got := range report.Domains[0].Requirements { + if !reflect.DeepEqual(expected[i], *got) { + t.Errorf("SHA marking %v: Expected %v, got %v", test.name, expected[i], *got) } }