|
288 | 288 | fail('cannot create a source entry without specifying a location')
|
289 | 289 | }
|
290 | 290 | }
|
291 |
| - if (type($location, 'generalized') !~ Type[Array]) { |
| 291 | + if $location !~ Array { |
292 | 292 | warning('For deb822 sources, location must be specified as an array.')
|
293 | 293 | $_location = [$location]
|
294 |
| - } |
295 |
| - else { |
| 294 | + } else { |
296 | 295 | $_location = $location
|
297 | 296 | }
|
298 | 297 |
|
|
302 | 301 | } else {
|
303 | 302 | fail('os.distro.codename fact not available: release parameter required')
|
304 | 303 | }
|
| 304 | + } elsif $release !~ Array { |
| 305 | + warning("For deb822 sources, 'release' must be specified as an array. Converting to array.") |
| 306 | + $_release = [$release] |
305 | 307 | } else {
|
306 |
| - if (type($release, 'generalized') !~ Type[Array]) { |
307 |
| - warning("For deb822 sources, 'release' must be specified as an array. Converting to array.") |
308 |
| - $_release = [$release] |
309 |
| - } else { |
310 |
| - $_release = $release |
311 |
| - } |
| 308 | + $_release = $release |
312 | 309 | }
|
313 | 310 |
|
314 |
| - if (type($repos, 'generalized') !~ Type[Array]) { |
| 311 | + if $repos !~ Array { |
315 | 312 | warning("For deb822 sources, 'repos' must be specified as an array. Converting to array.")
|
316 | 313 | $_repos = split($repos, /\s+/)
|
317 | 314 | } else {
|
318 | 315 | $_repos = $repos
|
319 | 316 | }
|
320 | 317 |
|
321 |
| - if $architecture != undef { |
322 |
| - if (type($architecture, 'generalized') !~ Type[Array]) { |
323 |
| - warning("For deb822 sources, 'architecture' must be specified as an array. Converting to array.") |
324 |
| - $_architecture = split($architecture, '[,]') |
325 |
| - } |
326 |
| - else { |
327 |
| - $_architecture = $architecture |
328 |
| - } |
| 318 | + if $architecture and $architecture !~ Array { |
| 319 | + warning("For deb822 sources, 'architecture' must be specified as an array. Converting to array.") |
| 320 | + $_architecture = split($architecture, '[,]') |
329 | 321 | } else {
|
330 | 322 | $_architecture = $architecture
|
331 | 323 | }
|
|
0 commit comments