Comment 1 for bug 1999901

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/867777
Committed: https://opendev.org/starlingx/distcloud/commit/b056a514c8cb4f63ea30c90dd50abe18ff19edfd
Submitter: "Zuul (22348)"
Branch: master

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>