]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat engine : Expose valid watch states via engine.api
authorSteven Hardy <shardy@redhat.com>
Wed, 29 Aug 2012 14:11:06 +0000 (15:11 +0100)
committerSteven Hardy <shardy@redhat.com>
Fri, 31 Aug 2012 15:11:28 +0000 (16:11 +0100)
Expose valid watch states via engine.api

Change-Id: I26a1d8939ce75a0be88e646858f3f3b4feb5e8d0
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/engine/api.py

index 95f346779ec3b8b9456b134b65856be916605ca5..05c3aaabdb5116ded76d16034739ebfc72ff0bad 100644 (file)
@@ -15,6 +15,7 @@
 import re
 from heat.common import utils as heat_utils
 from heat.engine import parser
+from heat.engine import watchrule
 
 from heat.openstack.common import log as logging
 
@@ -223,6 +224,12 @@ WATCH_RULE_KEYS = (
     'Statistic', 'Threshold', 'Unit', 'StackName')
 
 
+WATCH_STATES = (WATCH_STATE_OK, WATCH_STATE_ALARM, WATCH_STATE_NODATA
+    ) = (watchrule.WatchRule.NORMAL,
+         watchrule.WatchRule.ALARM,
+         watchrule.WatchRule.NODATA)
+
+
 def format_watch(watch):
 
     result = {