monasca-setup httpcheck args plugin: keystone_config
* httpcheck args plugin setup now creates keystone_config in init_config only if required. * unecessary keystone_config section in init_config for http_check.yaml file would cause all http check instances to fail because of missing keystone credentials like e.g. keystone_url, username, password, project. * This change creates a keystone_config section in init_config only if keystone_url is being passed as an argument during httpcheck plugin setup. Story: 2005296 Task: 30182 Change-Id: Id31d2e5b5d22cb6c6f1fbdb942dac4b1b5aea76d
This commit is contained in:
parent
2099661acb
commit
9375de2876
|
@ -56,6 +56,9 @@ class HttpCheck(monasca_setup.detection.ArgsPlugin):
|
|||
instance = self._build_instance(['url', 'timeout', 'username', 'password',
|
||||
'match_pattern', 'disable_ssl_validation',
|
||||
'name', 'use_keystone', 'collect_response_time'])
|
||||
|
||||
init_config = None
|
||||
if 'keystone_url' in self.args:
|
||||
init_config = {'keystone_config': self._build_instance(['keystone_url',
|
||||
'keystone_project',
|
||||
'keystone_project_domain',
|
||||
|
@ -74,6 +77,7 @@ class HttpCheck(monasca_setup.detection.ArgsPlugin):
|
|||
instance['name'] = self.args['url']
|
||||
|
||||
# Configure http check wide Keystone settings
|
||||
if init_config and ('keystone_config' in init_config):
|
||||
if 'keystone_project' in init_config['keystone_config']:
|
||||
init_config['keystone_config']['project_name'] = init_config['keystone_config']\
|
||||
.pop('keystone_project')
|
||||
|
@ -91,5 +95,4 @@ class HttpCheck(monasca_setup.detection.ArgsPlugin):
|
|||
.pop('keystone_password')
|
||||
|
||||
config['http_check'] = {'init_config': init_config, 'instances': [instance]}
|
||||
|
||||
return config
|
||||
|
|
Loading…
Reference in New Issue