Merge "remove url from v3 regions"

This commit is contained in:
Jenkins 2015-10-29 02:20:56 +00:00 committed by Gerrit Code Review
commit 58d0facd68
6 changed files with 23 additions and 110 deletions

View File

@ -102,6 +102,18 @@ List of Backwards Incompatible Changes
* Bug: 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
==============

View File

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

View File

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

View File

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

View File

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

View File

@ -61,19 +61,17 @@ class TestRegionCreate(TestRegion):
'description': identity_fakes.region_description,
'id': identity_fakes.region_id,
'parent_region': None,
'url': None,
}
self.regions_mock.create.assert_called_with(
**kwargs
)
collist = ('description', 'parent_region', 'region', 'url')
collist = ('description', 'parent_region', 'region')
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)
@ -94,19 +92,17 @@ class TestRegionCreate(TestRegion):
'description': None,
'id': identity_fakes.region_id,
'parent_region': None,
'url': None,
}
self.regions_mock.create.assert_called_with(
**kwargs
)
collist = ('description', 'parent_region', 'region', 'url')
collist = ('description', 'parent_region', 'region')
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)
@ -129,54 +125,17 @@ class TestRegionCreate(TestRegion):
'description': None,
'id': identity_fakes.region_id,
'parent_region': identity_fakes.region_parent_region_id,
'url': None,
}
self.regions_mock.create.assert_called_with(
**kwargs
)
collist = ('description', 'parent_region', 'region', 'url')
collist = ('description', 'parent_region', 'region')
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)
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)
@ -233,13 +192,12 @@ class TestRegionList(TestRegion):
columns, data = self.cmd.take_action(parsed_args)
self.regions_mock.list.assert_called_with()
collist = ('Region', 'Parent Region', 'Description', 'URL')
collist = ('Region', 'Parent Region', 'Description')
self.assertEqual(collist, columns)
datalist = ((
identity_fakes.region_id,
identity_fakes.region_parent_region_id,
identity_fakes.region_description,
identity_fakes.region_url,
), )
self.assertEqual(datalist, tuple(data))
@ -257,13 +215,12 @@ class TestRegionList(TestRegion):
self.regions_mock.list.assert_called_with(
parent_region_id=identity_fakes.region_parent_region_id)
collist = ('Region', 'Parent Region', 'Description', 'URL')
collist = ('Region', 'Parent Region', 'Description')
self.assertEqual(collist, columns)
datalist = ((
identity_fakes.region_id,
identity_fakes.region_parent_region_id,
identity_fakes.region_description,
identity_fakes.region_url,
), )
self.assertEqual(datalist, tuple(data))
@ -319,29 +276,6 @@ class TestRegionSet(TestRegion):
**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):
arglist = [
'--parent-region', 'new_parent',
@ -395,12 +329,11 @@ class TestRegionShow(TestRegion):
identity_fakes.region_id,
)
collist = ('description', 'parent_region', 'region', 'url')
collist = ('description', 'parent_region', 'region')
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)