From: Angus Salkeld Date: Wed, 14 Aug 2013 11:54:32 +0000 (+1000) Subject: Use the global environment to define AWS::CloudWatch::Alarm X-Git-Tag: 2014.1~177^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ead65c7e7ccdf17ed4c77f5903ae9c0441b6f242;p=openstack-build%2Fheat-build.git Use the global environment to define AWS::CloudWatch::Alarm This will make it easier for the deployer to define the default implementation. Change-Id: If1a8dceb4ad2cade90a56f16dd450e571425c4a6 --- diff --git a/etc/heat/environment.d/default.yaml b/etc/heat/environment.d/default.yaml new file mode 100644 index 00000000..ecc10cb0 --- /dev/null +++ b/etc/heat/environment.d/default.yaml @@ -0,0 +1,3 @@ + +resource_registry: + "AWS::CloudWatch::Alarm": "OS::Heat::CWLiteAlarm" diff --git a/heat/engine/resources/cloud_watch.py b/heat/engine/resources/cloud_watch.py index c5cab169..611bd56e 100644 --- a/heat/engine/resources/cloud_watch.py +++ b/heat/engine/resources/cloud_watch.py @@ -132,5 +132,5 @@ class CloudWatchAlarm(resource.Resource): def resource_mapping(): return { - 'AWS::CloudWatch::Alarm': CloudWatchAlarm, + 'OS::Heat::CWLiteAlarm': CloudWatchAlarm, } diff --git a/heat/tests/common.py b/heat/tests/common.py index 3b57dee9..97df88a8 100644 --- a/heat/tests/common.py +++ b/heat/tests/common.py @@ -16,7 +16,12 @@ 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)