From c50ffc9dc185d8aadb1f3addba4085cb8bfbf4d3 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Wed, 28 Feb 2018 11:45:01 +0100 Subject: [PATCH] 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 (cherry picked from commit 3a3b0f09db318faf1a1ea711a73bb365cab8b233) --- nova/context.py | 2 +- nova/tests/unit/test_context.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nova/context.py b/nova/context.py index b17c156ab718..7ea29f3c5697 100644 --- a/nova/context.py +++ b/nova/context.py @@ -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 = [] diff --git a/nova/tests/unit/test_context.py b/nova/tests/unit/test_context.py index 2603c67bbde7..e10e0caf1cee 100644 --- a/nova/tests/unit/test_context.py +++ b/nova/tests/unit/test_context.py @@ -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)