+# Defining backports for the apt class
class apt::backports (
Optional[String] $location = undef,
Optional[String] $release = undef,
}
} else {
unless $location and $release and $repos and $key {
- fail('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key')
+ fail(translate('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key'))
}
}
- if is_hash($pin) {
+ if $pin =~ Hash {
$_pin = $pin
- } elsif is_numeric($pin) or is_string($pin) {
+ } elsif $pin =~ Numeric or $pin =~ String {
# apt::source defaults to pinning to origin, but we should pin to release
# for backports
$_pin = {
'release' => $_release,
}
} else {
- fail('pin must be either a string, number or hash')
+ fail(translate('pin must be either a string, number or hash'))
}
apt::source { 'backports':