Comment 1 for bug 1980842

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

Reviewed: https://review.opendev.org/c/starlingx/config/+/848781
Committed: https://opendev.org/starlingx/config/commit/8033aae4478712bc37bfdd0848e8e60df104f720
Submitter: "Zuul (22348)"
Branch: master

commit 8033aae4478712bc37bfdd0848e8e60df104f720
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
    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.

    Closes-Bug: 1980842
    Signed-off-by: Joao Victor Portal <email address hidden>
    Change-Id: Ib9f72f3b2d4d60790fa8011674a013bcd141a61e