diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-08-10 20:08:44 +0100 |
---|---|---|
committer | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-08-10 20:20:31 +0100 |
commit | 9ba77114c66451ce0017f37d20cb10c27bdcd084 (patch) | |
tree | 42b7017d2df590802a4d1851c289c0a998da8a78 | |
parent | 83dbd06e1fee579d9873b8f6ca8292dccb91e51d (diff) | |
download | lorry-controller-9ba77114c66451ce0017f37d20cb10c27bdcd084.tar.gz |
readconf: Fix handling of invalid time values in configuration
ReadConfiguration.fix_up_interval was returning default_value when
the string value did not match the expected format. This variable
is not defined, but default_interval is.
This bug has been present since the beginning of LC development, and
was caught by pyflakes.
-rw-r--r-- | lorrycontroller/readconf.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lorrycontroller/readconf.py b/lorrycontroller/readconf.py index 23dfff1..512b558 100644 --- a/lorrycontroller/readconf.py +++ b/lorrycontroller/readconf.py @@ -174,7 +174,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute): return default_interval m = re.match('(\d+)\s*(s|m|h|d)?', value, re.I) if not m: - return default_value + return default_interval number, factor = m.groups() factors = { |