Skip to content

Commit aa054ec

Browse files
committed
(CONT-1028) Remove usage of legacy validate_re()
This deprecated function was removed from Puppet. The Puppet 4 type system can be used to ensure the validity of parameters with better error reporting.
1 parent bb59581 commit aa054ec

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

manifests/compose.pp

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,11 @@
3737
Optional[String] $version = $docker::params::compose_version,
3838
Optional[String] $install_path = $docker::params::compose_install_path,
3939
Optional[String] $symlink_name = $docker::params::compose_symlink_name,
40-
Optional[String] $proxy = undef,
40+
Optional[Pattern['^((http[s]?)?:\/\/)?([^:^@]+:[^:^@]+@|)([\da-z\.-]+)\.([\da-z\.]{2,6})(:[\d])?([\/\w \.-]*)*\/?$']] $proxy = undef,
4141
Optional[String] $base_url = $docker::params::compose_base_url,
4242
Optional[String] $raw_url = undef,
4343
Optional[Boolean] $curl_ensure = $docker::params::curl_ensure,
4444
) inherits docker::params {
45-
if $proxy != undef {
46-
validate_re($proxy, '^((http[s]?)?:\/\/)?([^:^@]+:[^:^@]+@|)([\da-z\.-]+)\.([\da-z\.]{2,6})(:[\d])?([\/\w \.-]*)*\/?$')
47-
}
4845

4946
if $facts['os']['family'] == 'windows' {
5047
$file_extension = '.exe'

manifests/machine.pp

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@
2424
Enum[present,absent] $ensure = 'present',
2525
Optional[String] $version = $docker::params::machine_version,
2626
Optional[String] $install_path = $docker::params::machine_install_path,
27-
Optional[String] $proxy = undef,
27+
Optional[Pattern['^((http[s]?)?:\/\/)?([^:^@]+:[^:^@]+@|)([\da-z\.-]+)\.([\da-z\.]{2,6})(:[\d])?([\/\w \.-]*)*\/?$']] $proxy = undef,
2828
Optional[Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl]] $url = undef,
2929
Optional[Boolean] $curl_ensure = $docker::params::curl_ensure,
3030
) inherits docker::params {
31-
if $proxy != undef {
32-
validate_re($proxy, '^((http[s]?)?:\/\/)?([^:^@]+:[^:^@]+@|)([\da-z\.-]+)\.([\da-z\.]{2,6})(:[\d])?([\/\w \.-]*)*\/?$')
33-
}
3431

3532
if $facts['os']['family'] == 'windows' {
3633
$file_extension = '.exe'

0 commit comments

Comments
 (0)