diff options
author | Julien Danjou <julien@danjou.info> | 2017-08-14 18:13:45 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2017-09-08 15:28:29 +0000 |
commit | 11be2c83145fc88bee657e9b14c9e5eca2410d6f (patch) | |
tree | cac4c8e69028014c2f3724864e6f8cb2893cd6b0 | |
parent | ef3cff89a8a4616ebbc5edaed61d80dabb0ae8b1 (diff) | |
download | ceilometer-11be2c83145fc88bee657e9b14c9e5eca2410d6f.tar.gz |
keystone: pass region name to keystone client9.0.1
If multiple Keystone are registered into the catalog and Keystone API is used
(e.g. gnocchi dispatcher uses it to find the project id), then the region is
picked randomly by Keystone client to choose the Keystone server.
Change-Id: Ia6ae72994431bfcf31c10866c7079784487411c1
(cherry picked from commit 89ef6422f150637cff0830cb88ec0b99ac00e49b)
-rw-r--r-- | ceilometer/keystone_client.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ceilometer/keystone_client.py b/ceilometer/keystone_client.py index f6b7559b..7323575b 100644 --- a/ceilometer/keystone_client.py +++ b/ceilometer/keystone_client.py @@ -38,10 +38,12 @@ def get_session(conf, requests_session=None, group=None, timeout=None): return session -def get_client(conf, trust_id=None, requests_session=None, group=None): +def get_client(conf, trust_id=None, requests_session=None, + group=DEFAULT_GROUP): """Return a client for keystone v3 endpoint, optionally using a trust.""" session = get_session(conf, requests_session=requests_session, group=group) - return ks_client_v3.Client(session=session, trust_id=trust_id) + return ks_client_v3.Client(session=session, trust_id=trust_id, + region_name=conf[group].region_name) def get_service_catalog(client): |