Update cinder in RequestContext service catalog
We've removed support for cinder v1 [1] and v2 [2]. The service catalog
entries for 'volume' and 'volumev2' are therefore no longer needed in
RequestContext.
Also, 'block-storage' is the official service type for cinder [3], so we
want to start supporting service catalogs with an entry for it.
[1] https://review.openstack.org/409904
[2] https://review.openstack.org/501874
[3] 671b42dda7/service-types.yaml (L68)
Change-Id: I8360b2a05e982285ad852aa475f1e1cd953c2c8b
This commit is contained in:
parent
253aad457f
commit
a03976ee89
@ -118,7 +118,7 @@ class RequestContext(context.RequestContext):
|
||||
if service_catalog:
|
||||
# Only include required parts of service_catalog
|
||||
self.service_catalog = [s for s in service_catalog
|
||||
if s.get('type') in ('volume', 'volumev2', 'volumev3',
|
||||
if s.get('type') in ('block-storage', 'volumev3',
|
||||
'key-manager', 'placement')]
|
||||
else:
|
||||
# if list is empty or none
|
||||
|
@ -102,14 +102,16 @@ class ContextTestCase(test.NoDBTestCase):
|
||||
{u'type': u'compute', u'name': u'nova'},
|
||||
{u'type': u's3', u'name': u's3'},
|
||||
{u'type': u'image', u'name': u'glance'},
|
||||
{u'type': u'volume', u'name': u'cinder'},
|
||||
{u'type': u'volumev3', u'name': u'cinderv3'},
|
||||
{u'type': u'ec2', u'name': u'ec2'},
|
||||
{u'type': u'object-store', u'name': u'swift'},
|
||||
{u'type': u'identity', u'name': u'keystone'},
|
||||
{u'type': u'block-storage', u'name': u'cinder'},
|
||||
{u'type': None, u'name': u'S_withouttype'},
|
||||
{u'type': u'vo', u'name': u'S_partofvolume'}]
|
||||
|
||||
volume_catalog = [{u'type': u'volume', u'name': u'cinder'}]
|
||||
volume_catalog = [{u'type': u'volumev3', u'name': u'cinderv3'},
|
||||
{u'type': u'block-storage', u'name': u'cinder'}]
|
||||
ctxt = context.RequestContext('111', '222',
|
||||
service_catalog=service_catalog)
|
||||
self.assertEqual(volume_catalog, ctxt.service_catalog)
|
||||
|
@ -1373,7 +1373,7 @@ class GetKSAAdapterTestCase(test.NoDBTestCase):
|
||||
min_version=None, max_version=None)
|
||||
|
||||
def test_load_auth_and_session(self):
|
||||
ret = utils.get_ksa_adapter('volumev2')
|
||||
ret = utils.get_ksa_adapter('volumev3')
|
||||
# Returned the result of load_adapter_from_conf_options
|
||||
self.assertEqual(self.load_adap.return_value, ret)
|
||||
# Had to load the auth
|
||||
|
Loading…
Reference in New Issue
Block a user