From c722195aee05bf83464995c3892919b4453833ad Mon Sep 17 00:00:00 2001 From: navum Date: Thu, 19 Jan 2023 12:14:01 +0000 Subject: [PATCH] Missing Location in http header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes the problem regarding the "Location" HTTP header which is missing in the response when changing external connectivity. According to the specification file, When operating on VNF instance resource. The VNFM returns a "202 Accepted" response with an empty payload body and a "Location" HTTP header that points to the new "Individual VNF LCM operation occurrence "resource, i.e. it includes the URI of that resource which is "…/vnf_lcm_op_occs/{vnfLcmOpOccId}" but now "Location" HTTP header is missing in the response when changing external connectivity. Closes-Bug: #1945387 Change-Id: I77c161b08c9c468fe6d4d243c1d098a0855bb2c8 --- tacker/api/vnflcm/v1/controller.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tacker/api/vnflcm/v1/controller.py b/tacker/api/vnflcm/v1/controller.py index 5f5e692be..06d0eaddd 100644 --- a/tacker/api/vnflcm/v1/controller.py +++ b/tacker/api/vnflcm/v1/controller.py @@ -1842,7 +1842,7 @@ class VnfLcmController(wsgi.Controller): 409, title='VNF IS NOT INSTANTIATED') vnf['before_error_point'] = EP.INITIAL - self._change_ext_conn(context, vnf_instance, vnf, body) + return self._change_ext_conn(context, vnf_instance, vnf, body) def _change_ext_conn(self, context, vnf_instance, vnf, request_body): req_body = utils.convert_camelcase_to_snakecase(request_body) @@ -1868,6 +1868,14 @@ class VnfLcmController(wsgi.Controller): change_ext_conn_req, vnf_lcm_op_occs_id) + # set response header + res = webob.Response() + res.status_int = 202 + location = ('Location', + self._get_vnf_lcm_op_occs_href(vnf_lcm_op_occs_id)) + res.headerlist.append(location) + return res + def create_resource(): return wsgi.Resource(VnfLcmController())