Merge "Do not add dimensions to init_config"
This commit is contained in:
commit
4bec3d0110
|
@ -24,14 +24,15 @@ class ArgsPlugin(Plugin):
|
|||
detection.
|
||||
"""
|
||||
|
||||
def _build_instance(self, arg_list):
|
||||
def _build_instance(self, arg_list, add_dimensions=True):
|
||||
"""If a value for each arg in the arg_list was specified build it into an instance
|
||||
dictionary. Also check for dimensions and add if they were specified.
|
||||
:param arg_list: Arguments to include
|
||||
:param add_dimensions: Specifies if dimensions should be added
|
||||
:return: instance dictionary
|
||||
"""
|
||||
instance = {}
|
||||
if 'dimensions' in self.args:
|
||||
if add_dimensions and 'dimensions' in self.args:
|
||||
instance['dimensions'] = dict(item.strip().split(":")
|
||||
for item in self.args['dimensions'].split(","))
|
||||
for arg in arg_list:
|
||||
|
|
|
@ -59,12 +59,14 @@ class HttpCheck(monasca_setup.detection.ArgsPlugin):
|
|||
|
||||
init_config = None
|
||||
if 'keystone_url' in self.args:
|
||||
init_config = {'keystone_config': self._build_instance(['keystone_url',
|
||||
'keystone_project',
|
||||
'keystone_project_domain',
|
||||
'keystone_user',
|
||||
'keystone_user_domain',
|
||||
'keystone_password'])}
|
||||
init_config = {'keystone_config': self._build_instance([
|
||||
'keystone_url',
|
||||
'keystone_project',
|
||||
'keystone_project_domain',
|
||||
'keystone_user',
|
||||
'keystone_user_domain',
|
||||
'keystone_password'],
|
||||
add_dimensions=False)}
|
||||
|
||||
# Normalize any boolean parameters
|
||||
for param in ['use_keystone', 'collect_response_time']:
|
||||
|
|
Loading…
Reference in New Issue