fixup! Support for Librato Alerts and Services

This commit is contained in:
Anthony Stanton 2016-08-31 17:19:53 +02:00
parent 2ba1c4e39a
commit 783b2e5780
No known key found for this signature in database
GPG Key ID: 42253AF31A97E303
1 changed files with 4 additions and 1 deletions

View File

@ -108,7 +108,10 @@ func resourceLibratoAlertConditionsHash(v interface{}) int {
var buf bytes.Buffer
m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%s-", m["type"].(string)))
buf.WriteString(fmt.Sprintf("%f-", m["threshold"].(float64)))
threshold, present := m["threshold"]
if present {
buf.WriteString(fmt.Sprintf("%f-", threshold.(float64)))
}
buf.WriteString(fmt.Sprintf("%s-", m["metric_name"].(string)))
return hashcode.String(buf.String())