@app.route('/report/latest/<node_name>', defaults={'env': app.config['DEFAULT_ENVIRONMENT']})
@app.route('/<env>/report/latest/<node_name>')
def report_latest(env, node_name):
    envs = environments()
    check_env(env, envs)

    if env == '*':
        node_query = '["=", "certname", "{0}"]'.format(node_name)
    else:
        node_query = '["and",' \
            '["=", "report_environment", "{0}"],' \
            '["=", "certname", "{1}"]]'.format(env, node_name)

    try:
        node = next(get_or_abort(puppetdb.nodes,
            query=node_query,
            with_status=True))
    except StopIteration:
        abort(404)

    if node.latest_report_hash is not None:
        hash_ = node.latest_report_hash
    else:
        if env == '*':
            query='["and",' \
                '["=", "certname", "{0}"],' \
                '["=", "latest_report?", true]]'.format(node.name)
        else:
            query='["and",' \
                '["=", "environment", "{0}"],' \
                '["=", "certname", "{1}"],' \
                '["=", "latest_report?", true]]'.format(
                    env,
                    node.name)

        reports = get_or_abort(puppetdb.reports, query=query)
        try:
            report = next(reports)
            hash_ = report.hash_
        except StopIteration:
            abort(404)

    return redirect(
        url_for('report', env=env, node_name=node_name, report_id=hash_))
Updates the MODIS and LANDSAT images for the current date
dataset/ETHPy150Open voxpupuli/puppetboard/puppetboard/app.py/report_latest--crossover with--dataset/ETHPy150Open nasa/CrisisMappingToolkit/cmt/util/production_gui.py/ProductionGui._loadImageData