Merge "Region update extra support"

This commit is contained in:
Zuul 2018-11-21 21:20:05 +00:00 committed by Gerrit Code Review
commit a32c596980
4 changed files with 28 additions and 0 deletions

View File

@ -174,6 +174,7 @@ class Catalog(base.CatalogDriverBase):
for attr in Region.attributes:
if attr != 'id':
setattr(ref, attr, getattr(new_region, attr))
ref.extra = new_region.extra
return ref.to_dict()
# Services

View File

@ -151,6 +151,20 @@ class CatalogTests(object):
self.assertEqual(new_description['description'],
current_region['description'])
def test_update_region_extras(self):
new_region = unit.new_region_ref()
region_id = new_region['id']
PROVIDERS.catalog_api.create_region(new_region)
email = 'keystone@openstack.org'
new_ref = {'description': uuid.uuid4().hex,
'email': email}
PROVIDERS.catalog_api.update_region(region_id, new_ref)
current_region = PROVIDERS.catalog_api.get_region(region_id)
self.assertEqual(email,
current_region['email'])
def test_create_region_with_duplicate_id(self):
new_region = unit.new_region_ref()
PROVIDERS.catalog_api.create_region(new_region)

View File

@ -249,6 +249,9 @@ class TestTemplatedCatalog(unit.TestCase, catalog_tests.CatalogTests):
def test_invalidate_cache_when_updating_region(self):
self.skip_test_overrides(BROKEN_WRITE_FUNCTIONALITY_MSG)
def test_update_region_extras(self):
self.skip_test_overrides(BROKEN_WRITE_FUNCTIONALITY_MSG)
def test_create_region_with_duplicate_id(self):
self.skip_test_overrides(BROKEN_WRITE_FUNCTIONALITY_MSG)

View File

@ -0,0 +1,10 @@
---
fixes:
- |
[`bug 1729933 <https://bugs.launchpad.net/keystone/+bug/1729933>`_]
The Region Update API now correctly updates extra values. Previously
adding any extra values to a region via the update API would discard
any added values besides the default ones. Any extra values are now
correctly added and returned. This fix was for consistency with other
APIs in keystone that use 'extra' and the use of 'extra' in
keystone is highly discouraged.