commit b056a514c8cb4f63ea30c90dd50abe18ff19edfd
Author: Karla Felix <email address hidden>
Date: Thu Dec 15 07:30:47 2022 -0300
Ignore JSON decode error in request log.
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 known all the possible request conditions that may
cause this exception to be thrown.
Test Plan:
PASS: Send a delete request through the CLI to subcloud-group and
verify if any exception shows up dcmanager-api logs.
Closes-Bug: 1999901
Change-Id: I58af3f4711d6caf840e188fb4690f2bde219d79a
Signed-off-by: Karla Felix <email address hidden>
Reviewed: https:/ /review. opendev. org/c/starlingx /distcloud/ +/867777 /opendev. org/starlingx/ distcloud/ commit/ b056a514c8cb4f6 3ea30c90dd50abe 18ff19edfd
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit b056a514c8cb4f6 3ea30c90dd50abe 18ff19edfd
Author: Karla Felix <email address hidden>
Date: Thu Dec 15 07:30:47 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 known all the possible request conditions that may
cause this exception to be thrown.
Test Plan:
PASS: Send a delete request through the CLI to subcloud-group and
verify if any exception shows up dcmanager-api logs.
Closes-Bug: 1999901 f840e188fb4690f 2bde219d79a
Change-Id: I58af3f4711d6ca
Signed-off-by: Karla Felix <email address hidden>