Disable cloud-watch-lite by default

This has been deprecated for years and is incompatible with deploying
multiple heat-engine processes. Let's at least not turn it on by default.

Change-Id: Iabddbd65be9000a30a5714b26658ea6acea0e103
This commit is contained in:
Zane Bitter 2015-05-07 17:00:16 -04:00 committed by Ethan Lynn
parent b764ee801b
commit bbf2913728
4 changed files with 30 additions and 15 deletions

View File

@ -149,7 +149,7 @@ engine_opts = [
help=_('RPC timeout for the engine liveness check that is used'
' for stack locking.')),
cfg.BoolOpt('enable_cloud_watch_lite',
default=True,
default=False,
help=_('Enable the legacy OS::Heat::CWLiteAlarm resource.')),
cfg.BoolOpt('enable_stack_abandon',
default=False,

View File

@ -100,19 +100,22 @@ class HeatTestCase(testscenarios.WithScenarios,
messaging.setup("fake://", optional=True)
self.addCleanup(messaging.cleanup)
tri = resources.global_env().get_resource_info(
'AWS::RDS::DBInstance',
registry_type=environment.TemplateResourceInfo)
if tri is not None:
cur_path = tri.template_name
templ_path = os.path.join(project_dir, 'etc', 'heat', 'templates')
if templ_path not in cur_path:
tri.template_name = cur_path.replace('/etc/heat/templates',
templ_path)
tri_names = ['AWS::RDS::DBInstance', 'AWS::CloudWatch::Alarm']
tris = []
for name in tri_names:
tris.append(resources.global_env().get_resource_info(
name,
registry_type=environment.TemplateResourceInfo))
for tri in tris:
if tri is not None:
cur_path = tri.template_name
templ_path = os.path.join(project_dir, 'etc',
'heat', 'templates')
if templ_path not in cur_path:
tri.template_name = cur_path.replace(
'/etc/heat/templates',
templ_path)
# use CWLiteAlarm for testing.
resources.global_env().registry.load(
{"AWS::CloudWatch::Alarm": "OS::Heat::CWLiteAlarm"})
if mock_keystone:
self.stub_keystoneclient()
utils.setup_dummy_db()

View File

@ -15,6 +15,8 @@ import mock
from heat.common import exception
from heat.common import template_format
from heat.engine import resource
from heat.engine import resources
from heat.engine.resources.openstack.heat import cloud_watch
from heat.engine import scheduler
from heat.engine import watchrule
@ -43,11 +45,22 @@ class CloudWatchAlarmTest(common.HeatTestCase):
def setUp(self):
super(CloudWatchAlarmTest, self).setUp()
def clear_register_class():
env = resources.global_env()
env.registry._registry.pop('CWLiteAlarmForTest')
self.ctx = utils.dummy_context()
resource._register_class('CWLiteAlarmForTest',
cloud_watch.CloudWatchAlarm)
self.addCleanup(clear_register_class)
def parse_stack(self):
t = template_format.parse(AWS_CloudWatch_Alarm)
self.stack = utils.parse_stack(t)
env = {'resource_registry': {
'AWS::CloudWatch::Alarm': 'CWLiteAlarmForTest'
}}
self.stack = utils.parse_stack(t, params=env)
return self.stack
def test_resource_create_good(self):

View File

@ -2279,7 +2279,6 @@ class StackServiceTest(common.HeatTestCase):
def test_list_resource_types_deprecated(self):
resources = self.eng.list_resource_types(self.ctx, "DEPRECATED")
self.assertEqual(set(['OS::Neutron::RouterGateway',
'OS::Heat::CWLiteAlarm',
'OS::Heat::HARestarter',
'OS::Heat::SoftwareDeployments',
'OS::Heat::StructuredDeployments']),