Merge "Do not add dimensions to init_config"
This commit is contained in:
@@ -24,14 +24,15 @@ class ArgsPlugin(Plugin):
|
|||||||
detection.
|
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
|
"""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.
|
dictionary. Also check for dimensions and add if they were specified.
|
||||||
:param arg_list: Arguments to include
|
:param arg_list: Arguments to include
|
||||||
|
:param add_dimensions: Specifies if dimensions should be added
|
||||||
:return: instance dictionary
|
:return: instance dictionary
|
||||||
"""
|
"""
|
||||||
instance = {}
|
instance = {}
|
||||||
if 'dimensions' in self.args:
|
if add_dimensions and 'dimensions' in self.args:
|
||||||
instance['dimensions'] = dict(item.strip().split(":")
|
instance['dimensions'] = dict(item.strip().split(":")
|
||||||
for item in self.args['dimensions'].split(","))
|
for item in self.args['dimensions'].split(","))
|
||||||
for arg in arg_list:
|
for arg in arg_list:
|
||||||
|
|||||||
@@ -59,12 +59,14 @@ class HttpCheck(monasca_setup.detection.ArgsPlugin):
|
|||||||
|
|
||||||
init_config = None
|
init_config = None
|
||||||
if 'keystone_url' in self.args:
|
if 'keystone_url' in self.args:
|
||||||
init_config = {'keystone_config': self._build_instance(['keystone_url',
|
init_config = {'keystone_config': self._build_instance([
|
||||||
'keystone_project',
|
'keystone_url',
|
||||||
'keystone_project_domain',
|
'keystone_project',
|
||||||
'keystone_user',
|
'keystone_project_domain',
|
||||||
'keystone_user_domain',
|
'keystone_user',
|
||||||
'keystone_password'])}
|
'keystone_user_domain',
|
||||||
|
'keystone_password'],
|
||||||
|
add_dimensions=False)}
|
||||||
|
|
||||||
# Normalize any boolean parameters
|
# Normalize any boolean parameters
|
||||||
for param in ['use_keystone', 'collect_response_time']:
|
for param in ['use_keystone', 'collect_response_time']:
|
||||||
|
|||||||
Reference in New Issue
Block a user