For DELETE requests with no request body or "Content-Length" field, the
expected return value for "hasattr(rest_state.request, 'json')" would be
False and for "rest_state.request.json" would be an empty string.
Instead, what occurs is that both "hasattr(rest_state.request, 'json')"
and "rest_state.request.json" are throwing JSON decode exceptions in
this case. This change adds tolerance for this exception. This is done
because it is not know all the possible request conditions that may
cause this exception to be thrown.
Test Plan:
PASS: Successfully deploy an AIO-SX using a Debian image with this
commit present and, using horizon interface, create and delete a data
network, checking that in log file "/var/log/sysinv-api.log" no
exception was thrown in the delete request.
Reviewed: https:/ /review. opendev. org/c/starlingx /config/ +/848781 /opendev. org/starlingx/ config/ commit/ 8033aae4478712b c37bfdd0848e8e6 0df104f720
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 8033aae4478712b c37bfdd0848e8e6 0df104f720
Author: Joao Victor Portal <email address hidden>
Date: Tue Jul 5 17:34:00 2022 -0300
Ignore JSON decode error in request log.
For DELETE requests with no request body or "Content-Length" field, the rest_state. request, 'json')" would be request. json" would be an empty string. rest_state. request, 'json')" request. json" are throwing JSON decode exceptions in
expected return value for "hasattr(
False and for "rest_state.
Instead, what occurs is that both "hasattr(
and "rest_state.
this case. This change adds tolerance for this exception. This is done
because it is not know all the possible request conditions that may
cause this exception to be thrown.
Test Plan:
PASS: Successfully deploy an AIO-SX using a Debian image with this sysinv- api.log" no
commit present and, using horizon interface, create and delete a data
network, checking that in log file "/var/log/
exception was thrown in the delete request.
Closes-Bug: 1980842 790fa8011674a01 3bcd141a61e
Signed-off-by: Joao Victor Portal <email address hidden>
Change-Id: Ib9f72f3b2d4d60