diff --git a/cve-vulner-manager/conf/product_app.conf b/cve-vulner-manager/conf/product_app.conf index 8293b1ccc446b479cf560c23ca3c77bf3e672170..cab1f8cad145846dd0f0583455de511e76c5e897 100644 --- a/cve-vulner-manager/conf/product_app.conf +++ b/cve-vulner-manager/conf/product_app.conf @@ -179,7 +179,7 @@ cve_number_t = 2018 # Create an issue's repo whitelist;1: open; 2: close issue_whitelist = 2 # List of affected branches: openEuler-20.03-LTS,openEuler-20.03-LTS-SP1 -affected_branchs = "openEuler-20.03-LTS-SP1,openEuler-20.03-LTS-SP3,openEuler-20.03-LTS-SP4,openEuler-22.03-LTS,openEuler-22.03-LTS-SP1,openEuler-22.03-LTS-SP2" +affected_branchs = "openEuler-20.03-LTS-SP1,openEuler-20.03-LTS-SP3,openEuler-20.03-LTS-SP4,openEuler-22.03-LTS,openEuler-22.03-LTS-SP1,openEuler-22.03-LTS-SP2,openEuler-22.03-LTS-SP3" abandoned_branchs = "openEuler-20.03-LTS,openEuler-21.03,openEuler-21.09,openEuler-20.09" # Close the highest privilege of issue:1:open;2:close close_issue_privilege = 2 diff --git a/cve-vulner-manager/cve-ddd/adapter/hotpatch.go b/cve-vulner-manager/cve-ddd/adapter/hotpatch.go index 8766c32de1baf8bfb76b004b4403f357b9e37e20..20b780591a6663895d64a47d41a5bf2922e50b5b 100644 --- a/cve-vulner-manager/cve-ddd/adapter/hotpatch.go +++ b/cve-vulner-manager/cve-ddd/adapter/hotpatch.go @@ -10,8 +10,8 @@ import ( "time" "github.com/astaxie/beego" + "github.com/astaxie/beego/logs" "github.com/opensourceways/server-common-lib/utils" - "github.com/sirupsen/logrus" "cvevulner/cve-ddd/app" "cvevulner/cve-ddd/infrastructure/bulletinimpl" @@ -57,7 +57,7 @@ type Issue struct { func (h *hotPatch) Process() { issues, err := h.getIssues() if err != nil { - logrus.Errorf("get hot patch issue error: %s", err.Error()) + logs.Error("get hot patch issue error: %s", err.Error()) return } @@ -66,7 +66,7 @@ func (h *hotPatch) Process() { for _, v := range issues { pat, err := h.toPatchIssue(v.Body) if err != nil { - logrus.Errorf("issue number %s toPatchIssue error: %s", v.Number, err.Error()) + logs.Error("issue number %s toPatchIssue error: %s", v.Number, err.Error()) continue } pat.HotIssueNum = v.Number @@ -75,7 +75,7 @@ func (h *hotPatch) Process() { } if err := h.service.GenerateBulletins(patches); err != nil { - logrus.Errorf("generate bulletins error %s", err.Error()) + logs.Error("generate bulletins error %s", err.Error()) } } diff --git a/cve-vulner-manager/cve-ddd/app/hotpatch.go b/cve-vulner-manager/cve-ddd/app/hotpatch.go index 7069a28f189cd06bb495c5068f36382949a9c1c5..3791f8ff0da4fe96bda3d9bdd9c61b4f5c315671 100644 --- a/cve-vulner-manager/cve-ddd/app/hotpatch.go +++ b/cve-vulner-manager/cve-ddd/app/hotpatch.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/sirupsen/logrus" + "github.com/astaxie/beego/logs" "cvevulner/cve-ddd/domain" "cvevulner/cve-ddd/domain/bulletin" @@ -63,11 +63,11 @@ func (h *hotPatchService) GenerateBulletins(cmds []CmdToGenerateBulletins) error AffectedVersion: cmd.Branch, }) if err != nil { - logrus.Errorf("find cve %s, error %s", cmd.CveNum, err.Error()) + logs.Error("find cve %s, error %s", cmd.CveNum, err.Error()) return err } if len(cves) == 0 { - logrus.Errorf("find cve %s nil", cmd.CveNum) + logs.Error("find cve %s nil", cmd.CveNum) continue } // all cves have the same hot issue number @@ -84,14 +84,14 @@ func (h *hotPatchService) GenerateBulletins(cmds []CmdToGenerateBulletins) error xmlData, err := h.bulletin.Generate(&b) if err != nil { - logrus.Errorf("component: %s, to xml error: %s", b.Component, err.Error()) + logs.Error("component: %s, to xml error: %s", b.Component, err.Error()) continue } fileName := fmt.Sprintf("cvrf-%s.xml", b.Identification) if err := h.obs.UploadToDynamicDir(fileName, xmlData); err != nil { - logrus.Errorf("component: %s, upload to obs error: %s", b.Component, err.Error()) + logs.Error("component: %s, upload to obs error: %s", b.Component, err.Error()) continue } @@ -102,7 +102,7 @@ func (h *hotPatchService) GenerateBulletins(cmds []CmdToGenerateBulletins) error } if err := h.repository.SaveIssueNum(cmd.HotIssueNum); err != nil { - logrus.Errorf("save issue num %s error %s", cmd.HotIssueNum, err.Error()) + logs.Error("save issue num %s error %s", cmd.HotIssueNum, err.Error()) } } @@ -139,13 +139,13 @@ func (h *hotPatchService) uploadUpdateInfo(cves domain.Cves) error { for version, v := range cves.GroupByVersion() { bytes, err := h.updateInfo.Generate(v) if err != nil { - logrus.Errorf("generate updateinfo of %s error %s", version, err.Error()) + logs.Error("generate updateinfo of %s error %s", version, err.Error()) continue } fileName := fmt.Sprintf("%s_updateinfo.xlsx", version) if err := h.obs.UploadUpdateInfo(fileName, bytes); err != nil { - logrus.Errorf("version: %s, upload to obs error: %s", version, err.Error()) + logs.Error("version: %s, upload to obs error: %s", version, err.Error()) continue } @@ -178,7 +178,7 @@ func (h *hotPatchService) appendHotPatchToFiles(files []string) { func (h *hotPatchService) updateFileByContent(file, newContent string) { oldContent, err := h.obs.DownloadFromDynamicDir(file) if err != nil { - logrus.Errorf("download %s error: %s", file, err.Error()) + logs.Error("download %s error: %s", file, err.Error()) return } @@ -186,6 +186,6 @@ func (h *hotPatchService) updateFileByContent(file, newContent string) { oldContent = append(oldContent, newContent...) if err = h.obs.UploadToDynamicDir(file, oldContent); err != nil { - logrus.Errorf("upload %s error: %s", file, err.Error()) + logs.Error("upload %s error: %s", file, err.Error()) } } diff --git a/cve-vulner-manager/cve-ddd/infrastructure/bulletinimpl/impl.go b/cve-vulner-manager/cve-ddd/infrastructure/bulletinimpl/impl.go index d2c96c396ebea2799102c90c0cca6d3c72cd42e8..7a70890a13b6ca1e41b214f28ff09c96e1bc7653 100644 --- a/cve-vulner-manager/cve-ddd/infrastructure/bulletinimpl/impl.go +++ b/cve-vulner-manager/cve-ddd/infrastructure/bulletinimpl/impl.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/sirupsen/logrus" + "github.com/astaxie/beego/logs" "cvevulner/cve-ddd/domain" "cvevulner/cve-ddd/domain/dp" @@ -258,7 +258,7 @@ func (impl bulletinImpl) HotPatchTree(sb *domain.SecurityBulletin) HotPatchTree } if _, ok := archs[arch]; !ok { - logrus.Errorf("arch %s is unlegal", arch) + logs.Error("arch %s is unlegal", arch) continue }