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
changes/52/181152/5
Zane Bitter 8 years ago committed by Ethan Lynn
parent b764ee801b
commit bbf2913728
  1. 2
      heat/common/config.py
  2. 29
      heat/tests/common.py
  3. 15
      heat/tests/test_cloudwatch.py
  4. 1
      heat/tests/test_engine_service.py

@ -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,

@ -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)
# use CWLiteAlarm for testing.
resources.global_env().registry.load(
{"AWS::CloudWatch::Alarm": "OS::Heat::CWLiteAlarm"})
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)
if mock_keystone:
self.stub_keystoneclient()
utils.setup_dummy_db()

@ -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):

@ -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']),

Loading…
Cancel
Save