]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Use the global environment to define AWS::CloudWatch::Alarm
authorAngus Salkeld <asalkeld@redhat.com>
Wed, 14 Aug 2013 11:54:32 +0000 (21:54 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Wed, 21 Aug 2013 22:25:20 +0000 (08:25 +1000)
This will make it easier for the deployer to define the default
implementation.

Change-Id: If1a8dceb4ad2cade90a56f16dd450e571425c4a6

etc/heat/environment.d/default.yaml [new file with mode: 0644]
heat/engine/resources/cloud_watch.py
heat/tests/common.py

diff --git a/etc/heat/environment.d/default.yaml b/etc/heat/environment.d/default.yaml
new file mode 100644 (file)
index 0000000..ecc10cb
--- /dev/null
@@ -0,0 +1,3 @@
+
+resource_registry:
+    "AWS::CloudWatch::Alarm": "OS::Heat::CWLiteAlarm"
index c5cab169c01f8694a2544c8a09187add6c69af47..611bd56ed27af2610e052e6d8dcc3ae6dd4502d6 100644 (file)
@@ -132,5 +132,5 @@ class CloudWatchAlarm(resource.Resource):
 
 def resource_mapping():
     return {
-        'AWS::CloudWatch::Alarm': CloudWatchAlarm,
+        'OS::Heat::CWLiteAlarm': CloudWatchAlarm,
     }
index 3b57dee969594f8e2f8efc2d72edbec5ebe9ffa7..97df88a85eafba65ef506e47b8d00af238df19d1 100644 (file)
 import fixtures
 import logging
 import mox
+import os
+import sys
 import testtools
+
+from oslo.config import cfg
+
 import heat.engine.scheduler as scheduler
 
 
@@ -33,3 +38,10 @@ class HeatTestCase(testtools.TestCase):
             scheduler.ENABLE_SLEEP = True
 
         self.addCleanup(enable_sleep)
+
+        mod_dir = os.path.dirname(sys.modules[__name__].__file__)
+        project_dir = os.path.abspath(os.path.join(mod_dir, '../../'))
+        env_dir = os.path.join(project_dir, 'etc', 'heat',
+                               'environment.d')
+
+        cfg.CONF.set_default('environment_dir', env_dir)