Comment 2 for bug 1977517

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

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

commit ebd16cc31b096b41e3e08d1bb1a2f4cbd93f7774
Author: Heitor Matsui <email address hidden>
Date: Tue Jun 28 17:35:17 2022 -0300

    Align API types with database types

    In more recent versions of SQLAlchemy library the datatypes
    filters are stricter and now rejects strings with boolean values
    such as "True"/"False" to a field mapped as boolean in the
    underlying database.

    This commit:

    1. Aligns fields with API types mapped as string but with its
    database counterparts mapped as boolean, also changing places
    where the value was being compared as a string

    2. Fixes the bool_or_none function used to parse boolean types,
    as it was returning True when strings like 'false', 'n' and 'no'
    were passed as parameter

    3. Removes code from sensor and sensorgroup API that was checking
    the now boolean field against string values (confirmed that there
    are no references to force-action in hwmon code on metal repo)

    Test Plan:
    PASS: install/bootstrap/unlock host
    PASS: test cgtsclient system commands for changed attributes:
          - host: ttys_dcd
            (verified manifest apply msg on logs)
          - memory: hugepages_configured, vm_pending_as_percentage,
                    vm_hugepages_use_1G
            (executed "grep Huge /proc/meminfo" after host-unlock)
          - sensor: suppress
            (verified suppress/unsuppress msgs on logs)
          - sensorgroup: suppress
            (verified suppress/unsuppress msgs on logs)
            (verified propagated suppress/suppress msgs on logs)
    PASS: run AIO-SX upgrade successfully
    PASS: all of the above on Debian (except upgrade)

    Closes-bug: 1977517
    Change-Id: Ie78f98b1b6141dc7ea5e4a125c64d50e1993f582
    Signed-off-by: Heitor Matsui <email address hidden>