summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git-templates/description0
-rw-r--r--git-templates/git-daemon-export-ok0
-rwxr-xr-xlorry-controller-minion6
-rw-r--r--lorrycontroller/local.py7
-rw-r--r--lorrycontroller/status.py8
-rw-r--r--setup.py3
-rw-r--r--templates/status.tpl8
7 files changed, 22 insertions, 10 deletions
diff --git a/git-templates/description b/git-templates/description
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/git-templates/description
diff --git a/git-templates/git-daemon-export-ok b/git-templates/git-daemon-export-ok
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/git-templates/git-daemon-export-ok
diff --git a/lorry-controller-minion b/lorry-controller-minion
index dfae50f..1900313 100755
--- a/lorry-controller-minion
+++ b/lorry-controller-minion
@@ -73,7 +73,7 @@ class MINION(cliapp.Application):
metavar='CMD',
default='lorry')
- self.settings.string(
+ self.settings.string_list(
['lorry-config'],
'lorry configuration file to use',
metavar='LORRY_CFG')
@@ -167,8 +167,8 @@ class MINION(cliapp.Application):
self.settings['lorry-cmd']
]
- if self.settings['lorry-config']:
- argv.extend(['--config', self.settings['lorry-config']])
+ argv.extend(['--config=' + name
+ for name in self.settings['lorry-config']])
argv.append(self.temp_lorry_filename)
diff --git a/lorrycontroller/local.py b/lorrycontroller/local.py
index d55214d..aee87b8 100644
--- a/lorrycontroller/local.py
+++ b/lorrycontroller/local.py
@@ -16,6 +16,7 @@
import logging
import os
import os.path
+import sys
import cliapp
@@ -45,7 +46,11 @@ class LocalDownstream(hosts.DownstreamHost):
# These are idempotent, so we don't need to explicitly check
# whether the repository already exists
os.makedirs(repo_path, exist_ok=True)
- cliapp.runcmd(['git', 'init', '--bare', repo_path])
+ cliapp.runcmd(
+ ['git', 'init', '--bare',
+ '--template',
+ os.path.join(sys.prefix, 'share/lorry-controller/git-templates'),
+ repo_path])
if 'head' in metadata:
cliapp.runcmd(['git', '--git-dir', repo_path,
diff --git a/lorrycontroller/status.py b/lorrycontroller/status.py
index 8fbc1b7..8483485 100644
--- a/lorrycontroller/status.py
+++ b/lorrycontroller/status.py
@@ -103,8 +103,8 @@ class StatusRenderer(object):
free_bytes = result.f_bavail * result.f_bsize
return {
'disk_free': free_bytes,
- 'disk_free_mib': free_bytes / 1024**2,
- 'disk_free_gib': free_bytes / 1024**3,
+ 'disk_free_mib': free_bytes // 1024**2,
+ 'disk_free_gib': free_bytes // 1024**3,
}
def get_run_queue(self, statedb):
@@ -130,9 +130,9 @@ class StatusRenderer(object):
result = []
- hours = secs / 3600
+ hours = secs // 3600
secs %= 3600
- mins = secs / 60
+ mins = secs // 60
secs %= 60
if hours > 0:
diff --git a/setup.py b/setup.py
index a7de1e8..9dc2463 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2012-2019 Codethink Limited
+# Copyright (C) 2012-2020 Codethink Limited
from distutils.core import setup
@@ -16,6 +16,7 @@ setup(name='lorry-controller',
'lorry-controller-remove-old-jobs'],
packages=['lorrycontroller', 'lorrycontroller.migrations'],
data_files=[
+ ('share/lorry-controller/git-templates', glob.glob('git-templates/*')),
('share/lorry-controller/templates', glob.glob('templates/*')),
('share/lorry-controller/static', glob.glob('static/*')),
],
diff --git a/templates/status.tpl b/templates/status.tpl
index 277b4b8..ff572de 100644
--- a/templates/status.tpl
+++ b/templates/status.tpl
@@ -46,7 +46,13 @@
<p>Maximum number of jobs: {{max_jobs}}.</p>
- <p>Free disk space: {{disk_free_gib}} GiB.</p>
+ <p>Free disk space:
+% if disk_free_gib:
+ {{disk_free_gib}} GiB.
+% else:
+ {{disk_free_mib}} MiB.
+% end
+ </p>
<h2>Upstream Hosts</h2>