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)
Reviewed: https:/ /review. opendev. org/c/starlingx /config/ +/848026 /opendev. org/starlingx/ config/ commit/ ebd16cc31b096b4 1e3e08d1bb1a2f4 cbd93f7774
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit ebd16cc31b096b4 1e3e08d1bb1a2f4 cbd93f7774
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: bootstrap/ unlock host
(verified manifest apply msg on logs) configured, vm_pending_ as_percentage,
vm_ hugepages_ use_1G
(executed "grep Huge /proc/meminfo" after host-unlock)
(verified suppress/unsuppress msgs on logs)
(verified suppress/unsuppress msgs on logs)
(verified propagated suppress/suppress msgs on logs)
PASS: install/
PASS: test cgtsclient system commands for changed attributes:
- host: ttys_dcd
- memory: hugepages_
- sensor: suppress
- sensorgroup: suppress
PASS: run AIO-SX upgrade successfully
PASS: all of the above on Debian (except upgrade)
Closes-bug: 1977517 c7ea5e4a125c64d 50e1993f582
Change-Id: Ie78f98b1b6141d
Signed-off-by: Heitor Matsui <email address hidden>