diff options
Diffstat (limited to 'lorrycontroller')
-rw-r--r-- | lorrycontroller/local.py | 7 | ||||
-rw-r--r-- | lorrycontroller/status.py | 8 |
2 files changed, 10 insertions, 5 deletions
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: |