Skip to content

Commit

Permalink
Deprecate region enabled parameter
Browse files Browse the repository at this point in the history
We don't check for "enabled" in the region
anywhere thus deprecating it from the create()
and update calls of the v3/region.py. We dont
use it in schema [1] as well as [2].

[1] https://github.com/openstack/keystone/blob/master/keystone/catalog/schema.py#L34
[2] https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L33-L49

Change-Id: I0257d5d42916e3b4d008e592d54eeeebec591633
Partial-Bug: #1615076
  • Loading branch information
agarwalvishakha18 committed Sep 28, 2018
1 parent 7935208 commit b7db566
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions keystoneclient/tests/unit/v3/utils.py
Expand Up @@ -221,6 +221,8 @@ def assertEntityRequestBodyIs(self, entity):
self.assertRequestBodyIs(json=self.encode(entity))

def test_create(self, ref=None, req_ref=None):
deprecations = self.useFixture(client_fixtures.Deprecations())
deprecations.expect_deprecations()
ref = ref or self.new_ref()
manager_ref = ref.copy()
manager_ref.pop('id')
Expand Down Expand Up @@ -343,6 +345,8 @@ def test_find(self, ref=None):
self.assertQueryStringIs('')

def test_update(self, ref=None, req_ref=None):
deprecations = self.useFixture(client_fixtures.Deprecations())
deprecations.expect_deprecations()
ref = ref or self.new_ref()

self.stub_entity('PATCH', id=ref['id'], entity=ref)
Expand Down
11 changes: 11 additions & 0 deletions keystoneclient/v3/regions.py
Expand Up @@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.

from debtcollector import removals
from keystoneclient import base


Expand All @@ -34,6 +35,11 @@ class RegionManager(base.CrudManager):
collection_key = 'regions'
key = 'region'

@removals.removed_kwarg(
'enabled',
message='The enabled parameter is deprecated.',
version='3.18.0',
removal_version='4.0.0')
def create(self, id=None, description=None, enabled=True,
parent_region=None, **kwargs):
"""Create a region.
Expand Down Expand Up @@ -81,6 +87,11 @@ def list(self, **kwargs):
return super(RegionManager, self).list(
**kwargs)

@removals.removed_kwarg(
'enabled',
message='The enabled parameter is deprecated.',
version='3.18.0',
removal_version='4.0.0')
def update(self, region, description=None, enabled=None,
parent_region=None, **kwargs):
"""Update a region.
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/bug-1615076-26962c85aeaf288c.yaml
@@ -0,0 +1,5 @@
---
deprecations:
- |
The region resource in Keystone never support or contain "enabled" property.
Thus the property is deprecated and will be removed in future versions.

0 comments on commit b7db566

Please sign in to comment.