Skip to content

Commit 8bb52bd

Browse files
committed
(maint) replace legacy validate function with datatype
This replaces the validate_absolute_path() function call with a datatype from puppetlabs/stdlib. The type is available since the 4.13.1 release of stdlib (and this module already depends on 5.1 and newer). Some background: I'm currently debugging a slow pe-puppetserver metrics API. The puppet-profiler is enabled and provides metrics for all called functions. In our environment the puppet_agent module is the only one still using this legacy function. By replacing it with a datatype, it follows current best practice guides and also speeds up the API because it has to care about less metrics (in my specific case at least).
1 parent 88113c6 commit 8bb52bd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

manifests/init.pp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
$aix_source = 'puppet:///pe_packages',
118118
$use_alternate_sources = false,
119119
$alternate_pe_source = undef,
120-
$install_dir = undef,
120+
Optional[Stdlib::Absolutepath] $install_dir = undef,
121121
$disable_proxy = false,
122122
$proxy = undef,
123123
$install_options = [],
@@ -146,10 +146,6 @@
146146
fail('Only one of $source and $absolute_source can be set')
147147
}
148148

149-
if $facts['os']['family'] == 'windows' and $install_dir != undef {
150-
validate_absolute_path($install_dir)
151-
}
152-
153149
if $package_version == undef {
154150
info('puppet_agent performs no actions if a package_version is not specified')
155151
} elsif defined('$::pe_server_version') {

0 commit comments

Comments
 (0)