DaanHoogland commented on code in PR #10544:
URL: https://github.com/apache/cloudstack/pull/10544#discussion_r2075024754


##########
server/src/main/java/com/cloud/alert/AlertManagerImpl.java:
##########
@@ -723,15 +725,7 @@ public void clearAlert(short alertType, long dataCenterId, 
Long podId) {
     public void sendAlert(AlertType alertType, long dataCenterId, Long podId, 
Long clusterId, String subject, String content)
             throws MessagingException, UnsupportedEncodingException {
         logger.warn(String.format("alertType=[%s] dataCenterId=[%s] podId=[%s] 
clusterId=[%s] message=[%s].", alertType, dataCenterId, podId, clusterId, 
subject));
-        AlertVO alert = null;
-        if ((alertType != AlertManager.AlertType.ALERT_TYPE_HOST) && 
(alertType != AlertManager.AlertType.ALERT_TYPE_USERVM)
-                && (alertType != 
AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER) && (alertType != 
AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY)
-                && (alertType != AlertManager.AlertType.ALERT_TYPE_SSVM) && 
(alertType != AlertManager.AlertType.ALERT_TYPE_STORAGE_MISC)
-                && (alertType != 
AlertManager.AlertType.ALERT_TYPE_MANAGEMENT_NODE) && (alertType != 
AlertManager.AlertType.ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED)
-                && (alertType != 
AlertManager.AlertType.ALERT_TYPE_UPLOAD_FAILED) && (alertType != 
AlertManager.AlertType.ALERT_TYPE_OOBM_AUTH_ERROR)
-                && (alertType != AlertManager.AlertType.ALERT_TYPE_HA_ACTION) 
&& (alertType != AlertManager.AlertType.ALERT_TYPE_CA_CERT)) {
-            alert = _alertDao.getLastAlert(alertType.getType(), dataCenterId, 
podId, clusterId);
-        }
+        AlertVO alert = createAlertForTrivialAlertType(alertType, 
dataCenterId, podId, clusterId);

Review Comment:
   ```suggestion
           AlertVO alert = getAlertForTrivialAlertType(alertType, dataCenterId, 
podId, clusterId);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to