summaryrefslogtreecommitdiff
path: root/lorrycontroller
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2020-08-10 20:05:20 +0100
committerBen Hutchings <ben.hutchings@codethink.co.uk>2020-08-10 20:20:48 +0100
commita78d5086d9f0eabe9234ba3db5d15bd728512376 (patch)
tree68466125a6756f6cbd690c5a5bbfa3ad3216c44b /lorrycontroller
parentf79b095ece9ff3bc50545ae90aac5de8e5b354e7 (diff)
downloadlorry-controller-a78d5086d9f0eabe9234ba3db5d15bd728512376.tar.gz
Delete assignments to local variables that are not used later
pyflakes found various assignments to local variables which are not used again. In some cases we still need to evaluate the expression that's assigned. In most places we can delete the assignment entirely.
Diffstat (limited to 'lorrycontroller')
-rw-r--r--lorrycontroller/readconf.py7
-rw-r--r--lorrycontroller/stopjob.py2
2 files changed, 2 insertions, 7 deletions
diff --git a/lorrycontroller/readconf.py b/lorrycontroller/readconf.py
index 512b558..b488765 100644
--- a/lorrycontroller/readconf.py
+++ b/lorrycontroller/readconf.py
@@ -209,11 +209,6 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
timeout = section.get(
'lorry-timeout', self.DEFAULT_LORRY_TIMEOUT)
- try:
- old_lorry_info = statedb.get_lorry_info(path)
- except lorrycontroller.LorryNotFoundError:
- old_lorry_info = None
-
statedb.add_to_lorries(
path=path, text=text, from_host='', from_path='',
interval=interval, timeout=timeout)
@@ -244,7 +239,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
except yaml.YAMLError:
f.seek(0)
obj = json.load(f)
- except ValueError as e:
+ except ValueError:
logging.error('YAML and JSON problem in %s', filename)
return []
diff --git a/lorrycontroller/stopjob.py b/lorrycontroller/stopjob.py
index f2ead87..6472edb 100644
--- a/lorrycontroller/stopjob.py
+++ b/lorrycontroller/stopjob.py
@@ -32,7 +32,7 @@ class StopJob(lorrycontroller.LorryControllerRoute):
statedb = self.open_statedb()
with statedb:
try:
- path = statedb.find_lorry_running_job(job_id)
+ statedb.find_lorry_running_job(job_id)
except lorrycontroller.WrongNumberLorriesRunningJob:
logging.warning(
"Tried to kill job %s which isn't running" % job_id)