Skip to content

Commit

Permalink
(maint) Switch from is_function_available() to defined()
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 10, 2023
1 parent 6538137 commit a8fc54c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
$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'))
# To determine if this is a PE installation or not, we check if the `pe_anchor` resource type exists
# it's provided by the puppet_enterprise module
$_is_pe = defined('pe_anchor')
if $_is_pe {
# Calculate the default collection
$_pe_version = pe_build_version()
Expand Down

0 comments on commit a8fc54c

Please sign in to comment.