From 8f0ffc6e7a4309b6e2b49015ea32de6f671c4e4a Mon Sep 17 00:00:00 2001 From: "Q.hongtao" Date: Thu, 26 Mar 2020 18:16:56 +0800 Subject: [PATCH] Add nova_client's region option Uniform region opt format, and I only add region opt to nova_client. In many regions I find the error which should call region one, but call region second, it is confused. Change-Id: I642668d970f276a14692898acc628357aeaa4493 --- ...ate-keystone_client-region-option-b3f30100370a5471.yaml | 7 +++++++ vitrage/keystone_client.py | 4 ++-- vitrage/os_clients.py | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/deprecate-keystone_client-region-option-b3f30100370a5471.yaml diff --git a/releasenotes/notes/deprecate-keystone_client-region-option-b3f30100370a5471.yaml b/releasenotes/notes/deprecate-keystone_client-region-option-b3f30100370a5471.yaml new file mode 100644 index 000000000..cb71b714e --- /dev/null +++ b/releasenotes/notes/deprecate-keystone_client-region-option-b3f30100370a5471.yaml @@ -0,0 +1,7 @@ +--- +deprecations: + - The ``region-name`` is deprecated in keystone_client's cfgs, and + use ``region_name`` instead. + +upgrade: + - The deprecated ``os-region-name`` option has been dropped. \ No newline at end of file diff --git a/vitrage/keystone_client.py b/vitrage/keystone_client.py index 673373c8a..0f86933b7 100644 --- a/vitrage/keystone_client.py +++ b/vitrage/keystone_client.py @@ -83,9 +83,9 @@ def delete_trust_id(trust_id, auth_plugin): OPTS = [ - cfg.StrOpt('region-name', + cfg.StrOpt('region_name', default=os.environ.get('OS_REGION_NAME'), - deprecated_name="os-region-name", + deprecated_name="region-name", help='Region name to use for OpenStack service endpoints.'), cfg.StrOpt('interface', default=os.environ.get( diff --git a/vitrage/os_clients.py b/vitrage/os_clients.py index 8caca5e0a..c3c3e2c40 100644 --- a/vitrage/os_clients.py +++ b/vitrage/os_clients.py @@ -107,6 +107,7 @@ def nova_client(): n_client = driver_module('nova') client = n_client.Client( version=CONF.nova_version, + region_name=CONF.service_credentials.region_name, session=keystone_client.get_session(), ) LOG.info('Nova client created')