Allow 'network' in RequestContext service_catalog

When booting instances, nova might create neutron resources. For that,
the network service endpoint needs to be available. Otherwise we run
into:

EndpointNotFound: ['internal', 'public'] endpoint for network service \
not found

Change-Id: Iaed84826b76ab976ffdd1c93106b7bae700a64a9
Closes-Bug: #1752289
This commit is contained in:
Thomas Bechtold 2018-02-28 11:45:01 +01:00
parent 4bac420d85
commit 3a3b0f09db
2 changed files with 3 additions and 1 deletions

View File

@ -119,7 +119,7 @@ class RequestContext(context.RequestContext):
# Only include required parts of service_catalog
self.service_catalog = [s for s in service_catalog
if s.get('type') in ('image', 'block-storage', 'volumev3',
'key-manager', 'placement')]
'key-manager', 'placement', 'network')]
else:
# if list is empty or none
self.service_catalog = []

View File

@ -103,6 +103,7 @@ class ContextTestCase(test.NoDBTestCase):
{u'type': u's3', u'name': u's3'},
{u'type': u'image', u'name': u'glance'},
{u'type': u'volumev3', u'name': u'cinderv3'},
{u'type': u'network', u'name': u'neutron'},
{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'},
@ -112,6 +113,7 @@ class ContextTestCase(test.NoDBTestCase):
volume_catalog = [{u'type': u'image', u'name': u'glance'},
{u'type': u'volumev3', u'name': u'cinderv3'},
{u'type': u'network', u'name': u'neutron'},
{u'type': u'block-storage', u'name': u'cinder'}]
ctxt = context.RequestContext('111', '222',
service_catalog=service_catalog)