remove url from v3 regions

the parameter "url" was removed from Keystone, it was only added
for one release as part of an experimental support for adding
service providers.

BackwardsIncompatibleImpact
Closes-Bug: 1506841

Change-Id: I7a62fbf1d9bfa8e6dd8d619e98c32b9860348d2e
This commit is contained in:
Steve Martinelli 2015-10-18 15:32:45 -04:00
parent 6fdc9a891f
commit 539c39bfaf
6 changed files with 23 additions and 110 deletions

View File

@ -102,6 +102,18 @@ List of Backwards Incompatible Changes
* Bug: NA * Bug: NA
* Commit: NA * Commit: NA
8. `region` commands no longer support `url`
The Keystone team removed support for thr `url` attribute from the client
and server side. Changes to the `create`, `set` and `list` commands for
regions have been affected.
* In favor of: NA
* As of 1.9.0
* Removed in: NA
* Bug: https://launchpad.net/bugs/1506841
* Commit: https://review.openstack.org/#/c/236736/
For Developers For Developers
============== ==============

View File

@ -15,7 +15,6 @@ Create new region
os region create os region create
[--parent-region <region-id>] [--parent-region <region-id>]
[--description <description>] [--description <description>]
[--url <url>]
<region-id> <region-id>
.. option:: --parent-region <region-id> .. option:: --parent-region <region-id>
@ -26,10 +25,6 @@ Create new region
New region description New region description
.. option:: --url <url>
New region URL
.. _region_create-region-id: .. _region_create-region-id:
.. describe:: <region-id> .. describe:: <region-id>
@ -77,7 +72,6 @@ Set region properties
os region set os region set
[--parent-region <region-id>] [--parent-region <region-id>]
[--description <description>] [--description <description>]
[--url <url>]
<region-id> <region-id>
.. option:: --parent-region <region-id> .. option:: --parent-region <region-id>
@ -88,10 +82,6 @@ Set region properties
New region description New region description
.. option:: --url <url>
New region URL
.. _region_set-region-id: .. _region_set-region-id:
.. describe:: <region-id> .. describe:: <region-id>

View File

@ -32,13 +32,12 @@ class IdentityTests(test.TestCase):
'enabled', 'name', 'parent_id', 'links'] 'enabled', 'name', 'parent_id', 'links']
ROLE_FIELDS = ['id', 'name', 'links'] ROLE_FIELDS = ['id', 'name', 'links']
SERVICE_FIELDS = ['id', 'enabled', 'name', 'type', 'description'] SERVICE_FIELDS = ['id', 'enabled', 'name', 'type', 'description']
REGION_FIELDS = ['description', 'enabled', 'parent_region', REGION_FIELDS = ['description', 'enabled', 'parent_region', 'region']
'region', 'url']
ENDPOINT_FIELDS = ['id', 'region', 'region_id', 'service_id', ENDPOINT_FIELDS = ['id', 'region', 'region_id', 'service_id',
'service_name', 'service_type', 'enabled', 'service_name', 'service_type', 'enabled',
'interface', 'url'] 'interface', 'url']
REGION_LIST_HEADERS = ['Region', 'Parent Region', 'Description', 'URL'] REGION_LIST_HEADERS = ['Region', 'Parent Region', 'Description']
ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type', ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type',
'Enabled', 'Interface', 'URL'] 'Enabled', 'Interface', 'URL']
@ -194,7 +193,6 @@ class IdentityTests(test.TestCase):
def _create_dummy_region(self, parent_region=None, add_clean_up=True): def _create_dummy_region(self, parent_region=None, add_clean_up=True):
region_id = data_utils.rand_name('TestRegion') region_id = data_utils.rand_name('TestRegion')
description = data_utils.rand_name('description') description = data_utils.rand_name('description')
url = data_utils.rand_url()
parent_region_arg = '' parent_region_arg = ''
if parent_region is not None: if parent_region is not None:
parent_region_arg = '--parent-region %s' % parent_region parent_region_arg = '--parent-region %s' % parent_region
@ -202,10 +200,8 @@ class IdentityTests(test.TestCase):
'region create ' 'region create '
'%(parent_region_arg)s ' '%(parent_region_arg)s '
'--description %(description)s ' '--description %(description)s '
'--url %(url)s '
'%(id)s' % {'parent_region_arg': parent_region_arg, '%(id)s' % {'parent_region_arg': parent_region_arg,
'description': description, 'description': description,
'url': url,
'id': region_id}) 'id': region_id})
items = self.parse_show(raw_output) items = self.parse_show(raw_output)
self.assert_show_fields(items, self.REGION_FIELDS) self.assert_show_fields(items, self.REGION_FIELDS)

View File

@ -48,12 +48,6 @@ class CreateRegion(show.ShowOne):
metavar='<description>', metavar='<description>',
help=_('New region description'), help=_('New region description'),
) )
parser.add_argument(
'--url',
metavar='<url>',
help=_('New region url'),
)
return parser return parser
@utils.log_method(log) @utils.log_method(log)
@ -62,7 +56,6 @@ class CreateRegion(show.ShowOne):
region = identity_client.regions.create( region = identity_client.regions.create(
id=parsed_args.region, id=parsed_args.region,
url=parsed_args.url,
parent_region=parsed_args.parent_region, parent_region=parsed_args.parent_region,
description=parsed_args.description, description=parsed_args.description,
) )
@ -117,8 +110,8 @@ class ListRegion(lister.Lister):
if parsed_args.parent_region: if parsed_args.parent_region:
kwargs['parent_region_id'] = parsed_args.parent_region kwargs['parent_region_id'] = parsed_args.parent_region
columns_headers = ('Region', 'Parent Region', 'Description', 'URL') columns_headers = ('Region', 'Parent Region', 'Description')
columns = ('ID', 'Parent Region Id', 'Description', 'URL') columns = ('ID', 'Parent Region Id', 'Description')
data = identity_client.regions.list(**kwargs) data = identity_client.regions.list(**kwargs)
return (columns_headers, return (columns_headers,
@ -150,25 +143,16 @@ class SetRegion(command.Command):
metavar='<description>', metavar='<description>',
help=_('New region description'), help=_('New region description'),
) )
parser.add_argument(
'--url',
metavar='<url>',
help=_('New region url'),
)
return parser return parser
@utils.log_method(log) @utils.log_method(log)
def take_action(self, parsed_args): def take_action(self, parsed_args):
identity_client = self.app.client_manager.identity identity_client = self.app.client_manager.identity
if (not parsed_args.url if not parsed_args.parent_region and not parsed_args.description:
and not parsed_args.parent_region
and not parsed_args.description):
return return
kwargs = {} kwargs = {}
if parsed_args.url:
kwargs['url'] = parsed_args.url
if parsed_args.description: if parsed_args.description:
kwargs['description'] = parsed_args.description kwargs['description'] = parsed_args.description
if parsed_args.parent_region: if parsed_args.parent_region:

View File

@ -123,13 +123,11 @@ PROJECT_2 = {
} }
region_id = 'region_one' region_id = 'region_one'
region_url = 'http://localhost:1111'
region_parent_region_id = 'region_two' region_parent_region_id = 'region_two'
region_description = 'region one' region_description = 'region one'
REGION = { REGION = {
'id': region_id, 'id': region_id,
'url': region_url,
'description': region_description, 'description': region_description,
'parent_region_id': region_parent_region_id, 'parent_region_id': region_parent_region_id,
'links': base_url + 'regions/' + region_id, 'links': base_url + 'regions/' + region_id,

View File

@ -61,19 +61,17 @@ class TestRegionCreate(TestRegion):
'description': identity_fakes.region_description, 'description': identity_fakes.region_description,
'id': identity_fakes.region_id, 'id': identity_fakes.region_id,
'parent_region': None, 'parent_region': None,
'url': None,
} }
self.regions_mock.create.assert_called_with( self.regions_mock.create.assert_called_with(
**kwargs **kwargs
) )
collist = ('description', 'parent_region', 'region', 'url') collist = ('description', 'parent_region', 'region')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.region_description, identity_fakes.region_description,
identity_fakes.region_parent_region_id, identity_fakes.region_parent_region_id,
identity_fakes.region_id, identity_fakes.region_id,
identity_fakes.region_url,
) )
self.assertEqual(datalist, data) self.assertEqual(datalist, data)
@ -94,19 +92,17 @@ class TestRegionCreate(TestRegion):
'description': None, 'description': None,
'id': identity_fakes.region_id, 'id': identity_fakes.region_id,
'parent_region': None, 'parent_region': None,
'url': None,
} }
self.regions_mock.create.assert_called_with( self.regions_mock.create.assert_called_with(
**kwargs **kwargs
) )
collist = ('description', 'parent_region', 'region', 'url') collist = ('description', 'parent_region', 'region')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.region_description, identity_fakes.region_description,
identity_fakes.region_parent_region_id, identity_fakes.region_parent_region_id,
identity_fakes.region_id, identity_fakes.region_id,
identity_fakes.region_url,
) )
self.assertEqual(datalist, data) self.assertEqual(datalist, data)
@ -129,54 +125,17 @@ class TestRegionCreate(TestRegion):
'description': None, 'description': None,
'id': identity_fakes.region_id, 'id': identity_fakes.region_id,
'parent_region': identity_fakes.region_parent_region_id, 'parent_region': identity_fakes.region_parent_region_id,
'url': None,
} }
self.regions_mock.create.assert_called_with( self.regions_mock.create.assert_called_with(
**kwargs **kwargs
) )
collist = ('description', 'parent_region', 'region', 'url') collist = ('description', 'parent_region', 'region')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.region_description, identity_fakes.region_description,
identity_fakes.region_parent_region_id, identity_fakes.region_parent_region_id,
identity_fakes.region_id, identity_fakes.region_id,
identity_fakes.region_url,
)
self.assertEqual(datalist, data)
def test_region_create_url(self):
arglist = [
identity_fakes.region_id,
'--url', identity_fakes.region_url,
]
verifylist = [
('region', identity_fakes.region_id),
('url', identity_fakes.region_url),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
columns, data = self.cmd.take_action(parsed_args)
# Set expected values
kwargs = {
'description': None,
'id': identity_fakes.region_id,
'parent_region': None,
'url': identity_fakes.region_url,
}
self.regions_mock.create.assert_called_with(
**kwargs
)
collist = ('description', 'parent_region', 'region', 'url')
self.assertEqual(collist, columns)
datalist = (
identity_fakes.region_description,
identity_fakes.region_parent_region_id,
identity_fakes.region_id,
identity_fakes.region_url,
) )
self.assertEqual(datalist, data) self.assertEqual(datalist, data)
@ -233,13 +192,12 @@ class TestRegionList(TestRegion):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.regions_mock.list.assert_called_with() self.regions_mock.list.assert_called_with()
collist = ('Region', 'Parent Region', 'Description', 'URL') collist = ('Region', 'Parent Region', 'Description')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = (( datalist = ((
identity_fakes.region_id, identity_fakes.region_id,
identity_fakes.region_parent_region_id, identity_fakes.region_parent_region_id,
identity_fakes.region_description, identity_fakes.region_description,
identity_fakes.region_url,
), ) ), )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
@ -257,13 +215,12 @@ class TestRegionList(TestRegion):
self.regions_mock.list.assert_called_with( self.regions_mock.list.assert_called_with(
parent_region_id=identity_fakes.region_parent_region_id) parent_region_id=identity_fakes.region_parent_region_id)
collist = ('Region', 'Parent Region', 'Description', 'URL') collist = ('Region', 'Parent Region', 'Description')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = (( datalist = ((
identity_fakes.region_id, identity_fakes.region_id,
identity_fakes.region_parent_region_id, identity_fakes.region_parent_region_id,
identity_fakes.region_description, identity_fakes.region_description,
identity_fakes.region_url,
), ) ), )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
@ -319,29 +276,6 @@ class TestRegionSet(TestRegion):
**kwargs **kwargs
) )
def test_region_set_url(self):
arglist = [
'--url', 'new url',
identity_fakes.region_id,
]
verifylist = [
('url', 'new url'),
('region', identity_fakes.region_id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
result = self.cmd.run(parsed_args)
self.assertEqual(0, result)
# Set expected values
kwargs = {
'url': 'new url',
}
self.regions_mock.update.assert_called_with(
identity_fakes.region_id,
**kwargs
)
def test_region_set_parent_region_id(self): def test_region_set_parent_region_id(self):
arglist = [ arglist = [
'--parent-region', 'new_parent', '--parent-region', 'new_parent',
@ -395,12 +329,11 @@ class TestRegionShow(TestRegion):
identity_fakes.region_id, identity_fakes.region_id,
) )
collist = ('description', 'parent_region', 'region', 'url') collist = ('description', 'parent_region', 'region')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.region_description, identity_fakes.region_description,
identity_fakes.region_parent_region_id, identity_fakes.region_parent_region_id,
identity_fakes.region_id, identity_fakes.region_id,
identity_fakes.region_url,
) )
self.assertEqual(datalist, data) self.assertEqual(datalist, data)