summaryrefslogtreecommitdiff
path: root/nova/utils.py
diff options
context:
space:
mode:
authorEric Fried <openstack@fried.cc>2019-08-05 14:11:47 -0500
committerEric Fried <openstack@fried.cc>2019-08-16 17:36:31 -0500
commit4412a90cf1176c1268db2ad0de53d8bf6ff4aed2 (patch)
tree49c4ffe2e75a8bf9dbf3663cea0be57b86bcf3e3 /nova/utils.py
parenteb5f1372929b84c1f9da7bf87b4ec5edcb4e15f9 (diff)
downloadnova-4412a90cf1176c1268db2ad0de53d8bf6ff4aed2.tar.gz
Limit get_sdk_adapter to requested service type
Previously openstacksdk would process the config for *every* known service type, even though get_sdk_adapter only cares about one at a time. Aside from just being wasteful, this also resulted in weird log messages complaining about other conf sections that weren't set up properly for sdk consumption (which we don't care about). And that would happen every time we requested an sdk adapter. openstacksdk added support for restricting a Connection to a single service type via [1]. So this commit takes advantage of it. [1] https://review.opendev.org/674675 Change-Id: Ib0e43f6c9e28ce4f1ac1831a3e3558c825a372ca
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 05658f2f3e..8607c7ff1a 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -1249,7 +1249,8 @@ def get_sdk_adapter(service_type):
"""
confgrp = _get_conf_group(service_type)
_, sess = _get_auth_and_session(confgrp)
- conn = connection.Connection(session=sess, oslo_conf=CONF)
+ conn = connection.Connection(
+ session=sess, oslo_conf=CONF, service_types={service_type})
return getattr(conn, service_type)