From f9bea72ac5c6271d6bc23e27057a7c1dc33a2c62 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 25 Jul 2023 13:12:35 +0100 Subject: [PATCH] resource: Remove unused 'Resource.service' attribute This has been unused since we switched to discovery way back in change I11c16d37d3ab3d77bed3a0bcbd98f1fa33b9555f. Change-Id: I3a60ab7b5a9fcdee9765e3c53497d1c1c49c511f Signed-off-by: Stephen Finucane --- openstack/resource.py | 6 ------ openstack/tests/unit/compute/v2/test_limits.py | 1 - 2 files changed, 7 deletions(-) diff --git a/openstack/resource.py b/openstack/resource.py index e8c1830c2..35e9c908f 100644 --- a/openstack/resource.py +++ b/openstack/resource.py @@ -471,9 +471,6 @@ class Resource(dict): #: The base part of the URI for this resource. base_path = "" - #: The service associated with this resource to find the service URL. - service = None - #: Allow create operation for this resource. allow_create = False #: Allow get operation for this resource. @@ -1339,9 +1336,6 @@ class Resource(dict): # Resource class that is calling session.$something to be complete. if isinstance(session, adapter.Adapter): return session - if hasattr(session, '_sdk_connection'): - service_type = cls.service['service_type'] - return getattr(session._sdk_connection, service_type) raise ValueError( "The session argument to Resource methods requires either an" " instance of an openstack.proxy.Proxy object or at the very least" diff --git a/openstack/tests/unit/compute/v2/test_limits.py b/openstack/tests/unit/compute/v2/test_limits.py index 90da84d9d..4971dad1d 100644 --- a/openstack/tests/unit/compute/v2/test_limits.py +++ b/openstack/tests/unit/compute/v2/test_limits.py @@ -113,7 +113,6 @@ class TestRateLimit(base.TestCase): self.assertIsNone(sot.resource_key) self.assertIsNone(sot.resources_key) self.assertEqual("", sot.base_path) - self.assertIsNone(sot.service) self.assertFalse(sot.allow_create) self.assertFalse(sot.allow_fetch) self.assertFalse(sot.allow_commit)