Merge pull request #204 from corey-hammerton/pypuppetdb-0.2.1

Using new Node and Catalog fields available in pypuppetdb 0.2.1

With the latest_report_hash field available on the Node object the report_latest can be partially deprecated. Will hopefully be removed in the next major/minor release.
This commit is contained in:
Corey Hammerton
2016-01-18 20:03:55 -05:00
5 changed files with 53 additions and 17 deletions

View File

@@ -10,6 +10,7 @@
<th>Hostname</th>
<th>Version</th>
<th>Transaction UUID</th>
<th>Code ID</th>
</tr>
</thead>
<tbody>
@@ -17,6 +18,7 @@
<td><a href="{{url_for('node', env=current_env, node_name=catalog.node)}}">{{catalog.node}}</a></td>
<td>{{catalog.version}}</td>
<td>{{catalog.transaction_uuid}}</td>
<td>{{catalog.code_id}}</td>
</tr>
</tbody>
</table>

View File

@@ -79,14 +79,22 @@
{% if node.status != 'unchanged' %}
<tr>
<td>
{{macros.status_counts(status=node.status, node_name=node.name, events=node.events, unreported_time=node.unreported_time, current_env=current_env)}}
{% if node.latest_report_hash %}
{{macros.status_counts(status=node.status, node_name=node.name, events=node.events, unreported_time=node.unreported_time, current_env=current_env, report_hash=node.latest_report_hash)}}
{% else %}
{{macros.status_counts(status=node.status, node_name=node.name, events=node.events, unreported_time=node.unreported_time, current_env=current_env)}}
{% endif %}
</td>
<td>
<a href="{{url_for('node', env=current_env, node_name=node.name)}}">{{ node.name }}</a>
</td>
<td>
{% if node.report_timestamp %}
<a href="{{url_for('report_latest', env=current_env, node_name=node.name)}}" rel='utctimestamp'>{{ node.report_timestamp }}</a>
{% if node.latest_report_hash %}
<a href="{{url_for('report', env=current_env, node_name=node.name, report_id=node.latest_report_hash)}}" rel='utctimestamp'>{{ node.report_timestamp }}</a>
{% else %}
<a href="{{url_for('report_latest', env=current_env, node_name=node.name)}}" rel='utctimestamp'>{{ node.report_timestamp }}</a>
{% endif %}
{% else %}
<i class="large ban circle icon"></i>
{% endif %}

View File

@@ -18,13 +18,21 @@
{% for node in nodes %}
<tr>
<td>
{{macros.status_counts(status=node.status, node_name=node.name, events=node.events, unreported_time=node.unreported_time, current_env=current_env)}}
{% if node.latest_report_hash %}
{{macros.status_counts(status=node.status, node_name=node.name, events=node.events, unreported_time=node.unreported_time, current_env=current_env, report_hash=node.latest_report_hash)}}
{% else %}
{{macros.status_counts(status=node.status, node_name=node.name, events=node.events, unreported_time=node.unreported_time, current_env=current_env)}}
{% endif %}
</td>
<td><a href="{{url_for('node', env=current_env, node_name=node.name)}}">{{node.name}}</a></td>
<td><a rel="utctimestamp" href="{{url_for('catalog_node', env=current_env, node_name=node.name)}}">{{node.catalog_timestamp}}</a></td>
<td>
{% if node.report_timestamp %}
<a href="{{url_for('report_latest', env=current_env, node_name=node.name)}}" rel='utctimestamp'>{{ node.report_timestamp }}</a>
{% if node.latest_report_hash %}
<a href="{{url_for('report', env=current_env, node_name=node.name, report_id=node.latest_report_hash)}}" rel='utctimestamp'>{{ node.report_timestamp }}</a>
{% else %}
<a href="{{url_for('report_latest', env=current_env, node_name=node.name)}}" rel='utctimestamp'>{{ node.report_timestamp }}</a>
{% endif %}
{% else %}
<i class="large ban circle icon"></i>
{% endif %}