Merge "Fixes RequestContext initialization failure."

This commit is contained in:
Jenkins 2013-11-25 12:24:45 +00:00 committed by Gerrit Code Review
commit e92add8ee2
2 changed files with 4 additions and 2 deletions

View File

@ -84,7 +84,7 @@ class RequestContext(object):
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')]
if s.get('type') in ('volume',)]
else:
# if list is empty or none
self.service_catalog = []

View File

@ -95,7 +95,9 @@ class ContextTestCase(test.NoDBTestCase):
{u'type': u'volume', u'name': u'cinder'},
{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'identity', u'name': u'keystone'},
{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'}]
ctxt = context.RequestContext('111', '222',