Skip to content

Commit

Permalink
Sort alert definitions so recoveries come after problems. (HHQ-3142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Morgan committed May 22, 2009
1 parent 6877f5c commit a6c5ef3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hqu/hqapi1/app/AlertdefinitionController.groovy
Expand Up @@ -199,7 +199,7 @@ public class AlertdefinitionController extends ApiController {
out << failureXml
} else {
out << getSuccessXML()
for (definition in definitions) {
for (definition in definitions.sort {a, b -> a.id <=> b.id}) {
out << getAlertDefinitionXML(definition, false)
}
}
Expand All @@ -219,7 +219,8 @@ public class AlertdefinitionController extends ApiController {
renderXml() {
out << AlertDefinitionsResponse() {
out << getSuccessXML()
for (definition in definitions) {
// Order by id's so recoveries come after problem alerts
for (definition in definitions.sort {a, b -> a.id <=> b.id}) {
out << getAlertDefinitionXML(definition, noIds)
}
}
Expand Down

0 comments on commit a6c5ef3

Please sign in to comment.