diff --git a/manifests/source.pp b/manifests/source.pp index 70191993f7..5082a89f21 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -288,11 +288,10 @@ fail('cannot create a source entry without specifying a location') } } - if (type($location, 'generalized') !~ Type[Array]) { + if $location !~ Array { warning('For deb822 sources, location must be specified as an array.') $_location = [$location] - } - else { + } else { $_location = $location } @@ -302,30 +301,23 @@ } else { fail('os.distro.codename fact not available: release parameter required') } + } elsif $release !~ Array { + warning("For deb822 sources, 'release' must be specified as an array. Converting to array.") + $_release = [$release] } else { - if (type($release, 'generalized') !~ Type[Array]) { - warning("For deb822 sources, 'release' must be specified as an array. Converting to array.") - $_release = [$release] - } else { - $_release = $release - } + $_release = $release } - if (type($repos, 'generalized') !~ Type[Array]) { + if $repos !~ Array { warning("For deb822 sources, 'repos' must be specified as an array. Converting to array.") $_repos = split($repos, /\s+/) } else { $_repos = $repos } - if $architecture != undef { - if (type($architecture, 'generalized') !~ Type[Array]) { - warning("For deb822 sources, 'architecture' must be specified as an array. Converting to array.") - $_architecture = split($architecture, '[,]') - } - else { - $_architecture = $architecture - } + if $architecture and $architecture !~ Array { + warning("For deb822 sources, 'architecture' must be specified as an array. Converting to array.") + $_architecture = split($architecture, '[,]') } else { $_architecture = $architecture }