From e267db844ed41c9072c7a166273b8aa0e7ad750c Mon Sep 17 00:00:00 2001 From: Anthony Stanton Date: Wed, 31 Aug 2016 17:19:53 +0200 Subject: [PATCH] fixup! Support for Librato Alerts and Services --- resource_librato_alert.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resource_librato_alert.go b/resource_librato_alert.go index 0ee5517..7f778b5 100644 --- a/resource_librato_alert.go +++ b/resource_librato_alert.go @@ -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())