Skip to content

Commit 2ead2fd

Browse files
author
Jarret Lavallee
committed
(main) Remove the sort function
Prior to this commit, the sort function was used to sort the hosts returned from the PuppetDB queries. This commit moves the logic to the PuppetDB query to do the sorting and removes the sort function. This fixes compatibility with 5.x that did not have the sort function.
1 parent de83191 commit 2ead2fd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

functions/hosts_with_pe_profile.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function puppet_metrics_collector::hosts_with_pe_profile($profile) {
2222
type = 'Class' and
2323
title = 'Puppet_enterprise::Profile::${_profile}' and
2424
nodes { deactivated is null and expired is null }
25+
order by certname
2526
}").map |$nodes| { $nodes['certname'] }
2627
}
2728
else {

manifests/pe_metric.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
'metrics_type' => $metrics_type,
4848
'pe_version' => $facts['pe_server_version'],
4949
'clientcert' => $::clientcert,
50-
'hosts' => $hosts.sort(),
50+
'hosts' => $hosts,
5151
'metrics_port' => $metrics_port,
5252
'ssl' => $ssl,
5353
'excludes' => $excludes,

metadata.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"source": "https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector",
88
"project_page": "https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector",
99
"issues_url": "https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/issues",
10-
"dependencies": [
11-
],
10+
"dependencies": [],
1211
"operatingsystem_support": [
1312
{
1413
"operatingsystem": "RedHat",

0 commit comments

Comments
 (0)