diff options
-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) |