update aodh notifier when there're multiple regions

When there're multiple regions in openstack system, like 'regionOne' and
'regionTwo', aodh do not specify a region to get the endpoint of zaqar.

An endpoint url should be uniquely determined by 'service_id','interface',
'region_id'.

Closes-Bug: #1798033
Change-Id: I5b8d279d7ce08b165002422c07792f59f1e9912f
This commit is contained in:
changyufei 2018-10-16 13:10:30 +08:00
parent 2e3589ebc4
commit 8524e44826
1 changed files with 2 additions and 0 deletions

View File

@ -70,7 +70,9 @@ class ZaqarAlarmNotifier(notifier.AlarmNotifier):
z_srv = ks_client.services.find(
type=self.conf.service_types.zaqar)
endpoint_type = self.conf.service_credentials.interface
region_name = self.conf.service_credentials.region_name
z_endpoint = ks_client.endpoints.find(service_id=z_srv.id,
region_id=region_name,
interface=endpoint_type)
self._zendpoint = z_endpoint.url
except Exception: