Merge "Disable ec2 collector for deployed-server"

This commit is contained in:
Jenkins 2017-03-15 15:51:28 +00:00 committed by Gerrit Code Review
commit 6f3d3fb245
3 changed files with 10 additions and 8 deletions

View File

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

View File

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

View File

@ -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': []