Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit eca576ef1bdb6f0dcb0ca8002e953379f9fcae4a 1 parent c00ce09
Ryan Morgan authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 hqu/hqapi1/app/AlertdefinitionController.groovy
View
12 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)
}
Please sign in to comment.
Something went wrong with that request. Please try again.