summaryrefslogtreecommitdiff
path: root/lorry-controller
diff options
context:
space:
mode:
Diffstat (limited to 'lorry-controller')
-rwxr-xr-xlorry-controller17
1 files changed, 16 insertions, 1 deletions
diff --git a/lorry-controller b/lorry-controller
index 06dcea1..3ba576f 100755
--- a/lorry-controller
+++ b/lorry-controller
@@ -33,6 +33,13 @@ class LorryController(cliapp.Application):
'lorry-controller.conf',
metavar='CONFNAME',
default=defaults['config-name'])
+ self.settings.boolean(['lorry-verbose'],
+ 'Whether to pass --verbose to lorry'
+ default=True)
+ self.settings.string(['lorry-log'],
+ 'Log file name for lorry if wanted'
+ metaval='LORRYLOG',
+ default=None)
def process_args(self, args):
logging.info("Starting to control lorry")
@@ -53,6 +60,13 @@ class LorryController(cliapp.Application):
self.rungit(['reset', '--hard', 'origin/master'])
self.rungit(['clean', '-fdx'])
+ self.lorrycmd=[self.settings['lorry']]
+ if self.settings['lorry-verbose']:
+ self.lorrycmd += "--verbose"
+ if self.settings['lorry-log'] is not None:
+ self.lorrycmd += "--log"
+ self.lorrycmd += self.settings['lorry-log']
+
if not os.path.exists(os.path.join('git',
self.settings['config-name'])):
logging.error("Unable to find lorry-controller.conf in git")
@@ -119,7 +133,8 @@ class LorryController(cliapp.Application):
due = state['next-due']
if now >= due:
logging.debug("Running Lorry for: %s" % lorry)
- # TODO: Actually run the lorry
+ with mgr.runner(lorry) as runner:
+ runner.run_lorry(*self.lorrycmd)
while state['next-due'] <= now:
state['next-due'] += state['conf']['interval-parsed']
lorried += 1