From ac06c65d733ba02339bde7086b9fcd4062626199 Mon Sep 17 00:00:00 2001 From: Spencer Krum Date: Thu, 7 Nov 2013 12:52:44 -0800 Subject: [PATCH] puppetboard/app.py: Pep8 fixes --- puppetboard/app.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/puppetboard/app.py b/puppetboard/app.py index b10eb70..81e3b3a 100644 --- a/puppetboard/app.py +++ b/puppetboard/app.py @@ -103,7 +103,9 @@ def index(): 'avg_resources_node': "{0:10.6f}".format(avg_resources_node['Value']), } - nodes = puppetdb.nodes(unreported=app.config['UNRESPONSIVE_HOURS'], with_status=True) + nodes = puppetdb.nodes( + unreported=app.config['UNRESPONSIVE_HOURS'], + with_status=True) nodes_overview = [] stats = { @@ -146,8 +148,11 @@ def nodes(): provide a search feature instead. """ status_arg = request.args.get('status', '') + nodelist = puppetdb.nodes( + unreported=app.config['UNRESPONSIVE_HOURS'], + with_status=True) nodes = [] - for node in yield_or_stop(puppetdb.nodes(unreported=app.config['UNRESPONSIVE_HOURS'], with_status=True)): + for node in yield_or_stop(nodelist): if status_arg: if node.status == status_arg: nodes.append(node) @@ -252,12 +257,18 @@ def fact(fact): name=fact, facts=localfacts))) + @app.route('/fact//') def fact_value(fact, value): """On asking for fact/value get all nodes with that fact.""" facts = get_or_abort(puppetdb.facts, fact, value) localfacts = [f for f in yield_or_stop(facts)] - return render_template('fact.html', name=fact, value=value, facts=localfacts) + return render_template( + 'fact.html', + name=fact, + value=value, + facts=localfacts) + @app.route('/query', methods=('GET', 'POST')) def query():