Removing the ten_reports method and passed the reports count through to the reports_node page

This commit is contained in:
stack72
2014-05-16 17:00:35 -05:00
parent 81c71607ae
commit 85dd8da276
3 changed files with 6 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ from pypuppetdb import connect
from puppetboard.forms import QueryForm
from puppetboard.utils import (
get_or_abort, yield_or_stop,
ten_reports, limit_reports, jsonprint
limit_reports, jsonprint
)
@@ -193,12 +193,13 @@ def reports():
def reports_node(node):
"""Fetches all reports for a node and processes them eventually rendering
a table displaying those reports."""
reports = ten_reports(yield_or_stop(
puppetdb.reports('["=", "certname", "{0}"]'.format(node))))
reports = limit_reports(yield_or_stop(
puppetdb.reports('["=", "certname", "{0}"]'.format(node))), app.config['REPORTS_COUNT'])
return render_template(
'reports_node.html',
reports=reports,
nodename=node)
nodename=node,
reports_count=app.config['REPORTS_COUNT'])
@app.route('/report/latest/<node_name>')