Strings evaluated as boolean
Some variables are assigned string values "True" or "False" but then are compared with booleans True and False.
Symptoms are incorrect behaviors like:
- preventing the Frontend fo match jobs [#21898]
- odd behaviors due to the incorrect evaluation
Here the new occurrence in 3.4.4
Turned out that this issue was not actually solved. The changes I made did fix an issue with the unsanitized classad GLIDEIN_REQUIRE_GLEXEC_USE , but the source of the original issue was in another place that is only triggered when glidein_glexec_use is set to NEVER (which I had not in my tests!).
The task of this ticket is to check the code looking for similar patterns and fix if there are other cases of mixed-use.
egrep -R '\[.attrs.\]' * | egrep -i '(false|true)' | grep -v "^doc" | less
showed that also GLIDEIN_In_Downtime is used incorrectly and should be fixed.
The line used to evaluate the truthiness of these attributes should probably become a function since is being used many times (is_false()):
(str(glidein["attrs"].get("GLIDEIN_REQUIRE_GLEXEC_USE", False)).lower() == "false")
unless it is always inside the match expression where imports are difficult.
the is_true() or is_false() functions could be added to the unit tests