diff options
author | Pedro Alvarez Piedehierro <palvarez89@gmail.com> | 2017-07-08 00:26:42 +0100 |
---|---|---|
committer | Pedro Alvarez Piedehierro <palvarez89@gmail.com> | 2017-07-13 19:20:32 +0100 |
commit | 79bdd7d34958d5b84dce7d44c16154eb20cbfd1f (patch) | |
tree | d6c6edecdf8cd8a734352ddfbf7243c97bbae980 | |
parent | 7ca915a812db8662362bfec4b335ba781531ae88 (diff) | |
download | lorry-controller-79bdd7d34958d5b84dce7d44c16154eb20cbfd1f.tar.gz |
status: send 'publish-failures' option to template
-rw-r--r-- | lorrycontroller/status.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lorrycontroller/status.py b/lorrycontroller/status.py index 40bf964..58669fb 100644 --- a/lorrycontroller/status.py +++ b/lorrycontroller/status.py @@ -1,4 +1,4 @@ -# Copyright (C) 2014 Codethink Limited +# Copyright (C) 2014-2017 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,6 +39,7 @@ class StatusRenderer(object): 'warning_msg': '', 'max_jobs': self.get_max_jobs(statedb), 'links': True, + 'publish_failures': True, } status.update(self.get_free_disk_space(work_directory)) return status @@ -46,9 +47,11 @@ class StatusRenderer(object): def render_status_as_html(self, template, status): return bottle.template(template, **status) - def write_status_as_html(self, template, status, filename): + def write_status_as_html(self, template, status, filename, + publish_failures): modified_status = dict(status) modified_status['links'] = False + modified_status['publish_failures'] = publish_failures html = self.render_status_as_html(template, modified_status) # We write the file first to a temporary file and then @@ -167,7 +170,8 @@ class Status(lorrycontroller.LorryControllerRoute): renderer.write_status_as_html( self._templates['status'], status, - self.app_settings['status-html']) + self.app_settings['status-html'], + self.app_settings['publish-failures']) return status @@ -185,6 +189,7 @@ class StatusHTML(lorrycontroller.LorryControllerRoute): renderer.write_status_as_html( self._templates['status'], status, - self.app_settings['status-html']) + self.app_settings['status-html'], + self.app_settings['publish-failures']) return renderer.render_status_as_html( self._templates['status'], status) |