Browse Source

Fix collectd plugins when 'internalURL' isn't set

It is possible to register a service in the Keystone catalog without
internalURL. This change fixes the collectd plugins to support that
configuration.

Change-Id: Id5ef3c4fcd473b92855cb656a80435d670062cfb
Closes-Bug: #1676755
changes/02/450602/4
Simon Pasquier 2 years ago
parent
commit
b5a12ffbfa
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py

+ 6
- 1
deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py View File

@@ -104,11 +104,16 @@ class OSClient(object):
self.service_catalog = []
for item in data['access']['serviceCatalog']:
endpoint = item['endpoints'][0]
if 'internalURL' not in endpoint and 'publicURL' not in endpoint:
self.logger.warning(
"Service '{}' skipped because no URL can be found".format(
item['name']))
continue
self.service_catalog.append({
'name': item['name'],
'region': endpoint['region'],
'service_type': item['type'],
'url': endpoint['internalURL'],
'url': endpoint.get('internalURL', endpoint.get('publicURL')),
'admin_url': endpoint['adminURL'],
})


Loading…
Cancel
Save