Merge "Add OpenStack-image-import-methods header"

This commit is contained in:
Jenkins 2017-05-26 15:46:06 +00:00 committed by Gerrit Code Review
commit d0f8c353ce
1 changed files with 5 additions and 0 deletions

View File

@ -807,6 +807,11 @@ class ResponseSerializer(wsgi.JSONResponseSerializer):
response.status_int = http.CREATED
self.show(response, image)
response.location = self._get_image_href(image)
# TODO(jokke): make this configurable when swift-local is implemented
# and remove the if statement with the config option.
if CONF.enable_image_import:
import_methods = "OpenStack-image-import-methods: glance-direct"
response.headerlist.extend([import_methods])
def show(self, response, image):
image_view = self._format_image(image)