[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Condor-devel] param_integer() handling input errors
- Date: Wed, 31 Jan 2007 17:18:53 -0600
- From: Dan Bradley <dan@xxxxxxxxxxxx>
- Subject: [Condor-devel] param_integer() handling input errors
Currently param_integer(), param_float(), and param_boolean() do a poor
job of validating input. For example, the following entry in the config
file
A = 12*60
results in this:
param_integer("A",300) --> 12
without any warning in the log!
If the value doesn't happen to start with an integer, the behavior is
different: param_integer() returns the default value and prints a
warning in the log at D_CONFIG level.
I have committed a fix for some of these problems in 6.9 branch. It
still falls back on the default value (should EXCEPT in my opinion), but
at least it does this consistently in all cases where the input value is
not the expected format, and it prints a warning in D_ALWAYS debug level.
None of this helps if we have code that uses param() directly and then
parses it with no validity checking, so please try to use these
convenience functions that do the parsing and validating for you.
--Dan