Skip to content

Commit

Permalink
Ubuntu: Issue EOL warning for unsupported release.
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulbhatia committed Sep 12, 2016
1 parent cf722cc commit 33fabe0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'lsbdistid' => $::lsbdistid,
'lsbdistcodename' => $::lsbdistcodename,
'lsbmajdistrelease' => $::lsbmajdistrelease,
'lsbdistrelease' => $::lsbdistrelease,
}
} else {
# Strict variables facts lookup compatibility
Expand All @@ -37,6 +38,10 @@
true => $::lsbmajdistrelease,
default => undef,
},
'lsbdistrelease' => defined('$lsbdistrelease') ? {
true => $::lsbdistrelease,
default => undef,
},
}
}

Expand Down Expand Up @@ -71,7 +76,7 @@
]

}
'trusty', 'utopic', 'vivid', 'wily': {
'trusty', 'wily': {
$legacy_origin = true
$origins = [
'${distro_id}:${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
Expand All @@ -84,6 +89,7 @@
]
}
default: {
warning("Ubuntu ${xfacts['lsbdistrelease']} \"${xfacts['lsbdistcodename']}\" has reached End of Life - please upgrade!")
$legacy_origin = true
$origins = [
'${distro_id}:${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
Expand Down
3 changes: 3 additions & 0 deletions spec/classes/unattended_upgrades_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@
};/x
)
end
# TODO: implement test case for "warning", similar to
# w = 'Ubuntu 15.04 "vivid" has reached End of Life - please upgrade!'
# it_behaves_like 'has_warning', pp, w
end

context 'with defaults on Ubuntu 15.10 Wily Werewolf' do
Expand Down

0 comments on commit 33fabe0

Please sign in to comment.