Add faultwrap filter to paste pipeline for heat-all

Without using the faultwrap filter, exceptions raised by heat-engine are
not translated into HTTPException subclasses that are understood by
webob.

This causes the exceptions to not be appropriately handled and the
correct HTTP codes are not returned to the client. Instead the exception
is assumed to be a 500 Internal Server Error instead of an informative
HTTP code (such as 404 for stack not found). Several spots in
tripleoclient/tripleo-common rely on known HTTP codes (such as 404)
being returned, so this commit adds the faultwrap filter to do the
translation.

Change-Id: I9cb25e6de5acce7e433aa559ca515ee7f3eb8dbf
Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
James Slagle 2021-01-28 17:47:08 -05:00
parent 336808ba57
commit 54d7271c66
1 changed files with 4 additions and 1 deletions

View File

@ -223,7 +223,7 @@ limit_iterators=9000
heat_api_paste_config = '''
[pipeline:heat-api-noauth]
pipeline = noauth context versionnegotiation apiv1app
pipeline = faultwrap noauth context versionnegotiation apiv1app
[app:apiv1app]
paste.app_factory = heat.common.wsgi:app_factory
heat.app_factory = heat.api.openstack.v1:API
@ -234,6 +234,9 @@ paste.filter_factory = heat.common.context:ContextMiddleware_filter_factory
[filter:versionnegotiation]
paste.filter_factory = heat.common.wsgi:filter_factory
heat.filter_factory = heat.api.openstack:version_negotiation_filter
[filter:faultwrap]
paste.filter_factory = heat.common.wsgi:filter_factory
heat.filter_factory = heat.api.openstack:faultwrap_filter
'''
with open(self.paste_file, 'w') as temp_file:
temp_file.write(heat_api_paste_config)