summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2020-08-10 20:08:44 +0100
committerBen Hutchings <ben.hutchings@codethink.co.uk>2020-08-10 20:20:31 +0100
commit9ba77114c66451ce0017f37d20cb10c27bdcd084 (patch)
tree42b7017d2df590802a4d1851c289c0a998da8a78
parent83dbd06e1fee579d9873b8f6ca8292dccb91e51d (diff)
downloadlorry-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.py2
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 = {