diff --git a/heat/engine/resources/openstack/nova/server.py b/heat/engine/resources/openstack/nova/server.py index c2271b653b..83247eb808 100644 --- a/heat/engine/resources/openstack/nova/server.py +++ b/heat/engine/resources/openstack/nova/server.py @@ -688,6 +688,7 @@ class Server(server_base.BaseServer, sh.SchedulerHintsMixin, super(Server, self).__init__(name, json_snippet, stack) if self.user_data_software_config(): self._register_access_key() + self.default_collectors = ['ec2'] def _config_drive(self): # This method is overridden by the derived CloudServer resource diff --git a/heat/engine/resources/server_base.py b/heat/engine/resources/server_base.py index 4f34750933..b06645aac9 100644 --- a/heat/engine/resources/server_base.py +++ b/heat/engine/resources/server_base.py @@ -36,6 +36,7 @@ class BaseServer(stack_user.StackUser): def __init__(self, name, json_snippet, stack): super(BaseServer, self).__init__(name, json_snippet, stack) + self.default_collectors = [] def _server_name(self): name = self.properties[self.NAME] @@ -48,7 +49,7 @@ class BaseServer(stack_user.StackUser): meta['deployments'] = meta.get('deployments', []) meta['os-collect-config'] = meta.get('os-collect-config', {}) occ = meta['os-collect-config'] - collectors = ['ec2'] + collectors = list(self.default_collectors) occ['collectors'] = collectors # set existing values to None to override any boot-time config diff --git a/heat/tests/openstack/heat/test_deployed_server.py b/heat/tests/openstack/heat/test_deployed_server.py index 8c132f9985..9ce055b09c 100644 --- a/heat/tests/openstack/heat/test_deployed_server.py +++ b/heat/tests/openstack/heat/test_deployed_server.py @@ -137,7 +137,7 @@ class DeployedServersTest(common.HeatTestCase): 'request': { 'metadata_url': metadata_url }, - 'collectors': ['ec2', 'request', 'local'] + 'collectors': ['request', 'local'] }, 'deployments': [] }, server.metadata_get()) @@ -188,7 +188,7 @@ class DeployedServersTest(common.HeatTestCase): 'secret_access_key': '8901', 'stack_name': 'server_sc_s' }, - 'collectors': ['ec2', 'cfn', 'local'] + 'collectors': ['cfn', 'local'] }, 'deployments': [] }, server.metadata_get()) @@ -208,7 +208,7 @@ class DeployedServersTest(common.HeatTestCase): 'secret_access_key': '8901', 'stack_name': 'server_sc_s' }, - 'collectors': ['ec2', 'cfn', 'local'], + 'collectors': ['cfn', 'local'], 'polling_interval': 10 }, 'deployments': [] @@ -251,7 +251,7 @@ class DeployedServersTest(common.HeatTestCase): 'stack_id': 'server_heat_s/%s' % stack.id, 'user_id': '1234' }, - 'collectors': ['ec2', 'heat', 'local'] + 'collectors': ['heat', 'local'] }, 'deployments': [] }, server.metadata_get()) @@ -270,7 +270,7 @@ class DeployedServersTest(common.HeatTestCase): 'stack_id': 'server_heat_s/%s' % stack.id, 'user_id': '1234' }, - 'collectors': ['ec2', 'heat', 'local'], + 'collectors': ['heat', 'local'], 'polling_interval': 10 }, 'deployments': [] @@ -327,7 +327,7 @@ class DeployedServersTest(common.HeatTestCase): 'project_id': '8888', 'queue_id': queue_id }, - 'collectors': ['ec2', 'zaqar', 'local'] + 'collectors': ['zaqar', 'local'] }, 'deployments': [] }, server.metadata_get()) @@ -344,7 +344,7 @@ class DeployedServersTest(common.HeatTestCase): 'project_id': '8888', 'queue_id': queue_id }, - 'collectors': ['ec2', 'zaqar', 'local'], + 'collectors': ['zaqar', 'local'], 'polling_interval': 10 }, 'deployments': []