From 9ba77114c66451ce0017f37d20cb10c27bdcd084 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 10 Aug 2020 20:08:44 +0100 Subject: 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. --- lorrycontroller/readconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = { -- cgit v1.2.1