예제 #1
0
파일: app.py 프로젝트: kayari75/puppetboard
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))))
    return render_template('reports_node.html', reports=reports, nodename=node)
예제 #2
0
파일: app.py 프로젝트: denmat/puppetboard
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))))
    return render_template(
        'reports_node.html',
        reports=reports,
        nodename=node)
예제 #3
0
def node(node_name):
    """Display a dashboard for a node showing as much data as we have on that
    node. This includes facts and reports but not Resources as that is too
    heavy to do within a single request.
    """
    node = get_or_abort(puppetdb.node, node_name)
    facts = node.facts()
    reports = ten_reports(node.reports())
    return render_template("node.html", node=node, facts=yield_or_stop(facts), reports=yield_or_stop(reports))
예제 #4
0
def reports_node(node):
    """Fetches all reports for a node and processes them eventually rendering
    a table displaying those reports."""
    if app.config["PUPPETDB_API"] > 2:
        reports = ten_reports(yield_or_stop(puppetdb.reports('["=", "certname", "{0}"]'.format(node))))
    else:
        log.warn("PuppetDB API prior to v3 cannot access reports.")
        abort(412)
    return render_template("reports_node.html", reports=reports, nodename=node)
예제 #5
0
파일: app.py 프로젝트: hunner/puppetboard
def reports_node(node):
    """Fetches all reports for a node and processes them eventually rendering
    a table displaying those reports."""
    if app.config["PUPPETDB_EXPERIMENTAL"]:
        reports = ten_reports(yield_or_stop(puppetdb.reports('["=", "certname", "{0}"]'.format(node))))
    else:
        log.warn("Access to experimental endpoint not allowed.")
        abort(412)
    return render_template("reports_node.html", reports=reports, nodename=node)
예제 #6
0
파일: app.py 프로젝트: denmat/puppetboard
def report_latest(node_name):
    """Redirect to the latest report of a given node. This is a workaround
    as long as PuppetDB can't filter reports for latest-report? field. This
    feature has been requested: http://projects.puppetlabs.com/issues/21554
    """
    # TODO: use limit parameter in _query to get just one report
    node = get_or_abort(puppetdb.node, node_name)
    reports = ten_reports(node.reports())
    report = list(yield_or_stop(reports))[0]
    return redirect(url_for('report', node=node_name, report_id=report))
예제 #7
0
def report_latest(node_name):
    """Redirect to the latest report of a given node. This is a workaround
    as long as PuppetDB can't filter reports for latest-report? field. This
    feature has been requested: http://projects.puppetlabs.com/issues/21554
    """
    # TODO: use limit parameter in _query to get just one report
    node = get_or_abort(puppetdb.node, node_name)
    reports = ten_reports(node.reports())
    report = list(yield_or_stop(reports))[0]
    return redirect(url_for('report', node=node_name, report_id=report))
예제 #8
0
def reports_node(node):
    """Fetches all reports for a node and processes them eventually rendering
    a table displaying those reports."""
    if app.config['PUPPETDB_EXPERIMENTAL']:
        reports = ten_reports(yield_or_stop(
            puppetdb.reports('["=", "certname", "{0}"]'.format(node))))
    else:
        log.warn('Access to experimental endpoint not allowed.')
        abort(412)
    return render_template('reports_node.html', reports=reports,
            nodename=node)
예제 #9
0
파일: app.py 프로젝트: kayari75/puppetboard
def node(node_name):
    """Display a dashboard for a node showing as much data as we have on that
    node. This includes facts and reports but not Resources as that is too
    heavy to do within a single request.
    """
    node = get_or_abort(puppetdb.node, node_name)
    facts = node.facts()
    reports = ten_reports(node.reports())
    return render_template('node.html',
                           node=node,
                           facts=yield_or_stop(facts),
                           reports=yield_or_stop(reports))
예제 #10
0
def node(node_name):
    """Display a dashboard for a node showing as much data as we have on that
    node. This includes facts and reports but not Resources as that is too
    heavy to do within a single request.
    """
    node = get_or_abort(puppetdb.node, node_name)
    facts =  node.facts()
    if app.config['PUPPETDB_EXPERIMENTAL']:
        reports = ten_reports(node.reports())
    else:
        reports = iter([])
    return render_template('node.html', node=node, facts=yield_or_stop(facts),
            reports=yield_or_stop(reports))