summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-04-01 11:21:13 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-04-01 11:21:13 +0000
commitc5e8f7efc7b03df7cc34c4e746c97cb0ff7e7901 (patch)
treeb182f7836863fae921e9406cab86d41a05c80f13
parent9aa0d69dde58438edbcc1a55998af1da2fc5349b (diff)
downloadlorry-controller-c5e8f7efc7b03df7cc34c4e746c97cb0ff7e7901.tar.gz
Use new_gitano_command from the right class
-rw-r--r--lorrycontroller/lstroves.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lorrycontroller/lstroves.py b/lorrycontroller/lstroves.py
index 20b06aa..1f10209 100644
--- a/lorrycontroller/lstroves.py
+++ b/lorrycontroller/lstroves.py
@@ -36,8 +36,9 @@ class GitanoLsError(Exception):
class TroveRepositoryLister(object):
- def __init__(self, app_settings):
+ def __init__(self, app_settings, route):
self.app_settings = app_settings
+ self.route = route
def list_trove_into_statedb(self, statedb, trove_info):
remote_paths = self.ls(statedb, trove_info)
@@ -69,7 +70,7 @@ class TroveRepositoryLister(object):
return None
def get_real_ls_output(self, statedb, trove_info):
- gitano = self.new_gitano_command(statedb, trove_info['trovehost'])
+ gitano = self.route.new_gitano_command(statedb, trove_info['trovehost'])
output = gitano.ls()
return self.parse_ls_output(output)
@@ -168,7 +169,7 @@ class ForceLsTrove(lorrycontroller.LorryControllerRoute):
trovehost = bottle.request.forms.trovehost
statedb = self.open_statedb()
- lister = TroveRepositoryLister(self.app_settings)
+ lister = TroveRepositoryLister(self.app_settings, self)
trove_info = statedb.get_trove_info(trovehost)
try:
updated = lister.list_trove_into_statedb(statedb, trove_info)
@@ -187,7 +188,7 @@ class LsTroves(lorrycontroller.LorryControllerRoute):
logging.info('%s %s called', self.http_method, self.path)
statedb = self.open_statedb()
- lister = TroveRepositoryLister(self.app_settings)
+ lister = TroveRepositoryLister(self.app_settings, self)
trove_infos = self.get_due_troves(statedb)
for trove_info in trove_infos: