Skip to content

Commit 6be21fb

Browse files
Added upgrade path for the alerts ALERT.VR.PUBLIC.IFACE.MTU, ALERT.VR.PRIVATE.IFACE.MTU
1 parent 6f7cc67 commit 6be21fb

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

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)