Skip to content

Commit

Permalink
Merge "Deprecate region enabled parameter"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Sep 28, 2018
2 parents abeacae + b7db566 commit 45cb387
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 45cb387

Please sign in to comment.