Skip to content

Commit

Permalink
Replace legacy is_function_available() with fact
Browse files Browse the repository at this point in the history
The `is_pe` fact is present on modern PE installations.
is_function_available() got removed in stdlib 9:
puppetlabs/puppetlabs-stdlib@0278618
  • Loading branch information
bastelfreak committed Jul 6, 2023
1 parent bb6498d commit b9083d1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@
$ssldir = "${confdir}/ssl"
$config = "${confdir}/puppet.conf"

# The `is_pe` fact currently works by echoing out the puppet version
# and greping for "puppet enterprise". With Puppet 4 and PE 2015.2, there
# is no longer a "PE Puppet", and so that fact will no longer work.
# Instead check for the `is_pe` fact or if a PE provided function is available
$_is_pe = (getvar('::is_pe') or is_function_available('pe_compiling_server_version'))
if $_is_pe {
if $facts['is_pe'] {
# Calculate the default collection
$_pe_version = pe_build_version()
# Not PE or pe_version < 2018.1.3, use PC1
Expand Down

0 comments on commit b9083d1

Please sign in to comment.