From 2a6e2380ad211e0a3931969c1bcc96c6a437ec88 Mon Sep 17 00:00:00 2001 From: Corey Hammerton Date: Tue, 28 Jun 2016 20:09:30 -0400 Subject: [PATCH] puppetboard/app.py: Using the plain-text metric name in metrics() (#259) This fixes #258 URL quoting is now done in pypuppetdb >= 0.2.3 which contributed to the metric URL being double-quoted by the time it reached PuppetDB, which responds with a 404. Instead using the plain-text name to build the link to metric() --- puppetboard/app.py | 4 +--- puppetboard/templates/metrics.html | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/puppetboard/app.py b/puppetboard/app.py index b411208..bf43d9b 100644 --- a/puppetboard/app.py +++ b/puppetboard/app.py @@ -771,10 +771,8 @@ def metrics(env): check_env(env, envs) metrics = get_or_abort(puppetdb._query, 'mbean') - for key, value in metrics.items(): - metrics[key] = value.split('/')[2] return render_template('metrics.html', - metrics=sorted(metrics.items()), + metrics=sorted(metrics.keys()), envs=envs, current_env=env) diff --git a/puppetboard/templates/metrics.html b/puppetboard/templates/metrics.html index 33af3c3..5ff3876 100644 --- a/puppetboard/templates/metrics.html +++ b/puppetboard/templates/metrics.html @@ -2,8 +2,8 @@ {% block content %}

Metrics

{% endblock content %}