Permalink
Browse files

Do not allow escalations to be set for recovery alerts. [HHQ-3188]

  • Loading branch information...
1 parent c00ce09 commit eca576ef1bdb6f0dcb0ca8002e953379f9fcae4a Ryan Morgan committed Jun 12, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 hqu/hqapi1/app/AlertdefinitionController.groovy
@@ -477,6 +477,8 @@ public class AlertdefinitionController extends ApiController {
templs = resource.metrics
}
+ def isRecovery = false
+
for (xmlCond in xmlDef['AlertCondition']) {
AlertConditionValue acv = new AlertConditionValue()
def acError
@@ -610,6 +612,8 @@ public class AlertdefinitionController extends ApiController {
break
}
+ isRecovery = true
+
// If a resource alert, look up alert by name
if (resource) {
log.debug("Looking up alerts for resource=" + resource.id)
@@ -723,7 +727,13 @@ public class AlertdefinitionController extends ApiController {
// Deal with Escalations
if (escalation) {
- pojo.setEscalation(user, escalation)
+ // TODO: Backend should handle escalations on recovery alerts
+ if (isRecovery) {
+ log.warn("Skipping escalation for definition '" + pojo.name +
+ "'. Escalations not allowed for recovery alerts.")
+ } else {
+ pojo.setEscalation(user, escalation)
+ }
} else {
pojo.unsetEscalation(user)
}

0 comments on commit eca576e

Please sign in to comment.