Merge branch 'corrective-policy' into 'corrective-policy'

Improve mail sending logic

See merge request entgra/carbon-device-mgt!656
corrective-policy
Inosh Perara 4 years ago
commit fcd4bc1a41

@ -4220,6 +4220,11 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
log.debug("Triggering Corrective action. Device Identifier: " + deviceIdentifier); log.debug("Triggering Corrective action. Device Identifier: " + deviceIdentifier);
} }
if (StringUtils.isBlank(featureCode)){
String msg = "Found a Blan feature code: " + featureCode;
log.error(msg);
throw new BadRequestException(msg);
}
if (configList == null || configList.isEmpty()) { if (configList == null || configList.isEmpty()) {
String msg = "Platform config is not configured"; String msg = "Platform config is not configured";
log.error(msg); log.error(msg);
@ -4236,7 +4241,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
for (String action : actions) { for (String action : actions) {
for (ConfigurationEntry config : configList) { for (ConfigurationEntry config : configList) {
if (config.getName().equals(featureCode)) { if (featureCode.equals(config.getName())) {
CorrectiveActionConfig correctiveActionConfig = (CorrectiveActionConfig) config.getValue(); CorrectiveActionConfig correctiveActionConfig = (CorrectiveActionConfig) config.getValue();
if (correctiveActionConfig.getActionTypes().contains(action)) { if (correctiveActionConfig.getActionTypes().contains(action)) {
if (DeviceManagementConstants.CorrectiveActions.E_MAIL.equals(action)) { if (DeviceManagementConstants.CorrectiveActions.E_MAIL.equals(action)) {

Loading…
Cancel
Save