Shade retrieves the list of all tenants and filters the result.
This can be a huge issue on platforms with tons of tenants.
OpenstackSDK's get_project method acts also like shade's get_project method,
but OpenstackSDK's identity manager just recovers the desired tenant, so we
use this.
Also we pass the OpenStackConfig instance to shade or openstacksdk
because if we don't, they re-instantiate one uselessly.
Reviewed: https:/ /review. opendev. org/644165 /git.openstack. org/cgit/ x/ospurge/ commit/ ?id=79ecb6f53c1 57b651d13cd97d5 dfdb7b8437042b
Committed: https:/
Submitter: Zuul
Branch: master
commit 79ecb6f53c157b6 51d13cd97d5dfdb 7b8437042b
Author: Yves-Gwenael Bourhis <email address hidden>
Date: Fri Mar 15 18:53:08 2019 +0100
To get tenant, use openstacksdk instead of shade.
Shade retrieves the list of all tenants and filters the result.
This can be a huge issue on platforms with tons of tenants.
OpenstackSDK's get_project method acts also like shade's get_project method,
but OpenstackSDK's identity manager just recovers the desired tenant, so we
use this.
Also we pass the OpenStackConfig instance to shade or openstacksdk
because if we don't, they re-instantiate one uselessly.
Closes-Bug: #1820616
Change-Id: I737b031fa9f2e4 394d58ac204bf28 b422cec1c28