File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 1111#
1212# $hosts: an array of certnames.
1313#
14- # Replaces the certname with '127.0.0.1' when the certname matches the localhost.
1514# Returns ['127.0.0.1'] when PuppetDB returns no hosts.
1615
1716function puppet_metrics_collector::hosts_with_pe_profile($profile ) {
@@ -21,19 +20,16 @@ function puppet_metrics_collector::hosts_with_pe_profile($profile) {
2120 type = 'Class' and
2221 title = 'Puppet_enterprise::Profile::${_profile}' and
2322 nodes { deactivated is null and expired is null }
24- }" ).map |$nodes | {
25- if $nodes [' certname' ] == $settings::certname {
26- ' 127.0.0.1'
27- } else {
28- $nodes [' certname' ]
29- }
30- }
31- } else {
23+ }" ).map |$nodes | { $nodes [' certname' ] }
24+ }
25+ else {
3226 $hosts = []
3327 }
28+
3429 if empty($hosts ) {
3530 [' 127.0.0.1' ]
36- } else {
31+ }
32+ else {
3733 sort($hosts )
3834 }
3935}
You can’t perform that action at this time.
0 commit comments