Skip to content

Commit

Permalink
Merge pull request #335 from mterzo/metrics_fix
Browse files Browse the repository at this point in the history
Metrics can appear as paths, if these paths are passed
  • Loading branch information
bastelfreak committed Jan 26, 2017
2 parents 144f772 + 5a12c08 commit 39ed8fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions puppetboard/app.py
Expand Up @@ -862,9 +862,9 @@ def metrics(env):
current_env=env)


@app.route('/metric/<metric>',
@app.route('/metric/<path:metric>',
defaults={'env': app.config['DEFAULT_ENVIRONMENT']})
@app.route('/<env>/metric/<metric>')
@app.route('/<env>/metric/<path:metric>')
def metric(env, metric):
"""Lists all information about the metric of the given name.
Expand All @@ -876,7 +876,7 @@ def metric(env, metric):
check_env(env, envs)

name = unquote(metric)
metric = puppetdb.metric(metric)
metric = get_or_abort(puppetdb.metric, metric)
return render_template(
'metric.html',
name=name,
Expand Down

0 comments on commit 39ed8fb

Please sign in to comment.