Skip to content

Commit

Permalink
修复系统报警规则重复创建的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxiangchun committed Jul 14, 2020
1 parent d10da02 commit 6576384
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/util/onecloud/onecloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ func GetCommonAlertOfSys(session *mcclient.ClientSession) ([]jsonutils.JSONObjec
param := jsonutils.NewDict()
param.Add(jsonutils.NewBool(true), "details")
param.Add(jsonutils.NewString(monitorapi.CommonAlertSystemAlertType), "alert_type")
param.Add(jsonutils.NewString("system"), "scope")

rtn, err := modules.CommonAlertManager.List(session, param)
if err != nil {
Expand Down Expand Up @@ -662,6 +663,7 @@ func CreateCommonAlert(s *mcclient.ClientSession, tem CommonAlertTem) (jsonutils
},
Recipients: []string{monitorapi.CommonAlertDefaultRecipient},
AlertType: monitorapi.CommonAlertSystemAlertType,
Scope: "system",
}

param := jsonutils.Marshal(&input)
Expand Down

0 comments on commit 6576384

Please sign in to comment.