Skip to content

Commit ff7ec0c

Browse files
Update alert id for VR public and private interface (#12527)
1 parent 6932cac commit ff7ec0c

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

api/src/main/java/org/apache/cloudstack/alert/AlertService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ private AlertType(short type, String name, boolean isDefault) {
7171
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true);
7272
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true);
7373
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
74-
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
75-
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
74+
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)33, "ALERT.VR.PUBLIC.IFACE.MTU", true);
75+
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)34, "ALERT.VR.PRIVATE.IFACE.MTU", true);
7676

7777
public short getType() {
7878
return type;

engine/components-api/src/main/java/com/cloud/alert/AlertManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,4 @@ public interface AlertManager extends Manager, AlertService {
5454
void recalculateCapacity();
5555

5656
void sendAlert(AlertType alertType, long dataCenterId, Long podId, String subject, String body);
57-
5857
}

engine/schema/src/main/resources/META-INF/db/schema-42020to42030.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
--;
2121

2222
ALTER TABLE `cloud`.`template_store_ref` MODIFY COLUMN `download_url` varchar(2048);
23+
24+
UPDATE `cloud`.`alert` SET type = 33 WHERE name = 'ALERT.VR.PUBLIC.IFACE.MTU';
25+
UPDATE `cloud`.`alert` SET type = 34 WHERE name = 'ALERT.VR.PRIVATE.IFACE.MTU';

server/src/main/java/com/cloud/event/AlertGenerator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ void init() {
6767
}
6868

6969
public static void publishAlertOnEventBus(String alertType, long dataCenterId, Long podId, String subject, String body) {
70-
7170
String configKey = Config.PublishAlertEvent.key();
7271
String value = s_configDao.getValue(configKey);
7372
boolean configValue = Boolean.parseBoolean(value);
74-
if(!configValue)
73+
if (!configValue) {
7574
return;
75+
}
76+
7677
try {
7778
eventDistributor = ComponentContext.getComponent(EventDistributor.class);
7879
} catch (NoSuchBeanDefinitionException nbe) {

0 commit comments

Comments
 (0)