From e11bb7c3c0f3439ccae95ce59603e83447b3431d Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 8 Aug 2024 17:53:17 +0100 Subject: [PATCH] Deprecate 'use_direct_get' parameter This is additional complexity that we don't want to support and won't be able to support once everything in the cloud layer is switched over to use the proxy layer. If users want control over this, they can use the 'get_xxx' methods in the proxy layer instead of the cloud layer. Change-Id: I76e9e2873ad57db673516c2b66f9280f6b0280be Signed-off-by: Stephen Finucane --- openstack/cloud/openstackcloud.py | 11 +++++++++-- openstack/connection.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/openstack/cloud/openstackcloud.py b/openstack/cloud/openstackcloud.py index e54f22b3e..33ef47c17 100644 --- a/openstack/cloud/openstackcloud.py +++ b/openstack/cloud/openstackcloud.py @@ -34,6 +34,7 @@ from openstack import exceptions from openstack import proxy from openstack import resource from openstack import utils +from openstack import warnings as os_warnings class _OpenStackCloudMixin(_services_mixin.ServicesMixin): @@ -68,7 +69,7 @@ class _OpenStackCloudMixin(_services_mixin.ServicesMixin): app_version=None, extra_services=None, strict=False, - use_direct_get=False, + use_direct_get=None, task_manager=None, rate_limit=None, oslo_conf=None, @@ -155,6 +156,12 @@ class _OpenStackCloudMixin(_services_mixin.ServicesMixin): """ super().__init__() + if use_direct_get is not None: + warnings.warn( + "The 'use_direct_get' argument is deprecated for removal", + os_warnings.RemovedInSDK50Warning, + ) + self.config = config self._extra_services = {} self._strict_proxies = strict_proxies @@ -196,7 +203,7 @@ class _OpenStackCloudMixin(_services_mixin.ServicesMixin): self._proxies = {} self.__pool_executor = pool_executor self._global_request_id = global_request_id - self.use_direct_get = use_direct_get + self.use_direct_get = use_direct_get or False self.strict_mode = strict self.log = _log.setup_logging('openstack') diff --git a/openstack/connection.py b/openstack/connection.py index 9b4066eea..0b202bf8a 100644 --- a/openstack/connection.py +++ b/openstack/connection.py @@ -362,7 +362,7 @@ class Connection( app_version=None, extra_services=None, strict=False, - use_direct_get=False, + use_direct_get=None, task_manager=None, rate_limit=None, oslo_conf=None,