From 31a158c375b62947cb7d38cc4068bbf0935ec933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Krienb=C3=BChl?= Date: Wed, 10 Sep 2014 16:10:38 +0200 Subject: [PATCH] Accept the configuration_version as alternative in the report view. --- puppetboard/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/puppetboard/app.py b/puppetboard/app.py index 11b1ccd..fed7d4e 100644 --- a/puppetboard/app.py +++ b/puppetboard/app.py @@ -226,11 +226,15 @@ def report_latest(node_name): def report(node, report_id): """Displays a single report including all the events associated with that report and their status. + + The report_id may be the puppetdb's report hash or the + configuration_version. This allows for better integration + into puppet-hipchat. """ reports = puppetdb.reports('["=", "certname", "{0}"]'.format(node)) for report in reports: - if report.hash_ == report_id: + if report.hash_ == report_id or report.version == report_id: events = puppetdb.events('["=", "report", "{0}"]'.format( report.hash_)) return render_template(