summaryrefslogtreecommitdiff
path: root/lorrycontroller
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2015-12-15 11:28:47 +0000
committerBen Brown <ben.brown@codethink.co.uk>2015-12-15 11:53:47 +0000
commitce7951ae8f2725c427388eece9c1ad1ef28ba810 (patch)
treebb7d0cb749446e7a9d7be02bacc4088e02be9ac3 /lorrycontroller
parentff83a8987cae6aba71e4b912d6f3dd7a390fc1c3 (diff)
downloadlorry-controller-ce7951ae8f2725c427388eece9c1ad1ef28ba810.tar.gz
Remove trailing whitespace
While we're here, seeing as Adam mentioned it. Change-Id: I5ddb86c70d76a84cf12fbd4eb91f3802e490d745
Diffstat (limited to 'lorrycontroller')
-rw-r--r--lorrycontroller/__init__.py2
-rw-r--r--lorrycontroller/gitano.py2
-rw-r--r--lorrycontroller/proxy.py8
-rw-r--r--lorrycontroller/readconf.py6
-rw-r--r--lorrycontroller/showlorry.py4
-rw-r--r--lorrycontroller/statedb.py10
6 files changed, 16 insertions, 16 deletions
diff --git a/lorrycontroller/__init__.py b/lorrycontroller/__init__.py
index 9d46441..2c4a1c2 100644
--- a/lorrycontroller/__init__.py
+++ b/lorrycontroller/__init__.py
@@ -17,7 +17,7 @@
from statedb import (
StateDB,
LorryNotFoundError,
- WrongNumberLorriesRunningJob,
+ WrongNumberLorriesRunningJob,
TroveNotFoundError)
from route import LorryControllerRoute
from readconf import ReadConfiguration
diff --git a/lorrycontroller/gitano.py b/lorrycontroller/gitano.py
index 6625757..c0cca05 100644
--- a/lorrycontroller/gitano.py
+++ b/lorrycontroller/gitano.py
@@ -94,7 +94,7 @@ class GitanoCommand(object):
if exit != 0:
logging.error(
- 'Failed to run "%s" for %s:\n%s',
+ 'Failed to run "%s" for %s:\n%s',
quoted_args, self.trovehost, stdout + stderr)
raise GitanoCommandFailure(
self.trovehost,
diff --git a/lorrycontroller/proxy.py b/lorrycontroller/proxy.py
index 22729d3..b9e75b8 100644
--- a/lorrycontroller/proxy.py
+++ b/lorrycontroller/proxy.py
@@ -36,15 +36,15 @@ def build_proxy_url(protocol, proxy_config):
def setup_proxy(config_filename):
"""Tell urllib2 to use a proxy for http action by lorry-controller.
-
+
Load the proxy information from the JSON file given by proxy_def, then
set urllib2's url opener to open urls via an authenticated proxy.
-
+
"""
-
+
if not os.path.exists(config_filename):
return
-
+
with open(config_filename, 'r') as f:
proxy_config = json.load(f)
diff --git a/lorrycontroller/readconf.py b/lorrycontroller/readconf.py
index f7a7404..4bcbce4 100644
--- a/lorrycontroller/readconf.py
+++ b/lorrycontroller/readconf.py
@@ -80,7 +80,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
logging.error(
'Unknown section in configuration: %r', section)
return (
- 'ERROR: Unknown section type in configuration: %r' %
+ 'ERROR: Unknown section type in configuration: %r' %
section)
for path in lorries_to_remove:
@@ -228,7 +228,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
pattern = os.path.join(dirname, base_pattern)
result.extend(glob.glob(pattern))
return result
-
+
def get_valid_lorry_specs(self, filename):
# We do some basic validation of the .lorry file and the Lorry
# specs contained within it. We silently ignore anything that
@@ -332,7 +332,7 @@ class LorryControllerConfValidator(object):
if type(conf_obj) is not list:
raise ValidationError(
'type %r is not a JSON list' % type(conf_obj))
-
+
def _check_is_list_of_dicts(self, conf_obj):
for item in conf_obj:
if type(item) is not dict:
diff --git a/lorrycontroller/showlorry.py b/lorrycontroller/showlorry.py
index 19f9429..d54073a 100644
--- a/lorrycontroller/showlorry.py
+++ b/lorrycontroller/showlorry.py
@@ -74,7 +74,7 @@ class ShowLorryHTML(ShowLorryBase, lorrycontroller.LorryControllerRoute):
lorry_info['last_run_nice'] = time.strftime(
'%Y-%m-%d %H:%M:%S UTC',
time.gmtime(lorry_info['last_run']))
-
+
lorry_info['disk_usage_nice'] = shower.format_bytesize(
lorry_info['disk_usage'])
@@ -82,7 +82,7 @@ class ShowLorryHTML(ShowLorryBase, lorrycontroller.LorryControllerRoute):
due = lorry_info['last_run'] + lorry_info['interval']
lorry_info['due_nice'] = renderer.format_due_nicely(due, now)
-
+
timestamp = time.strftime('%Y-%m-%d %H:%M:%S UTC', time.gmtime(now))
parts = urlparse.urlparse(bottle.request.url)
diff --git a/lorrycontroller/statedb.py b/lorrycontroller/statedb.py
index 7a26098..7f537f3 100644
--- a/lorrycontroller/statedb.py
+++ b/lorrycontroller/statedb.py
@@ -149,7 +149,7 @@ class StateDB(object):
# Stupid table we can always write to to trigger the start of
# a transaction.
c.execute('CREATE TABLE stupid (value INT)')
-
+
# Done.
self._conn.commit()
logging.debug('Finished initialising tables in STATEDB')
@@ -240,7 +240,7 @@ class StateDB(object):
prefixmap=None, ignore=None):
logging.debug(
'StateDB.add_trove(%r,%r,%r,%r,%r,%r) called',
- trovehost, lorry_interval, lorry_timeout, ls_interval,
+ trovehost, lorry_interval, lorry_timeout, ls_interval,
prefixmap, ignore)
assert trovehost is not None
@@ -264,7 +264,7 @@ class StateDB(object):
'prefixmap, ignore) '
'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
(trovehost, protocol, username, password,
- lorry_interval, lorry_timeout, ls_interval, 0,
+ lorry_interval, lorry_timeout, ls_interval, 0,
prefixmap, ignore))
else:
c = self.get_cursor()
@@ -273,7 +273,7 @@ class StateDB(object):
'SET lorry_interval=?, lorry_timeout=?, ls_interval=?, '
'prefixmap=?, ignore=?, protocol=? '
'WHERE trovehost IS ?',
- (lorry_interval, lorry_timeout, ls_interval, prefixmap,
+ (lorry_interval, lorry_timeout, ls_interval, prefixmap,
ignore, protocol, trovehost))
def remove_trove(self, trovehost):
@@ -603,7 +603,7 @@ class StateDB(object):
This is a generator.
'''
-
+
c = self.get_cursor()
c.execute('SELECT job_id, path, exit FROM jobs')
while True: