diff options
author | intrigeri <intrigeri@boum.org> | 2016-03-16 14:23:08 +0000 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2016-03-16 14:23:08 +0000 |
commit | 46b2f3d2e8c9c8646dfd51280c634ce517d795e6 (patch) | |
tree | ca4e9d9448b51b075c4c98f752c7281c636e23cb /lib/facter/ubuntu_nextcodename.rb | |
parent | 3630285006d9fb60c5fbecebc976623c37dd1395 (diff) | |
parent | 8c8bd7bb1e5cc0f5297db9629ece783452233d1f (diff) |
Merge remote-tracking branch 'shared/master' into bugfix/reboot-required-jessie
Diffstat (limited to 'lib/facter/ubuntu_nextcodename.rb')
-rw-r--r-- | lib/facter/ubuntu_nextcodename.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/facter/ubuntu_nextcodename.rb b/lib/facter/ubuntu_nextcodename.rb new file mode 100644 index 0000000..dcd1d42 --- /dev/null +++ b/lib/facter/ubuntu_nextcodename.rb @@ -0,0 +1,20 @@ +begin + require 'facter/util/ubuntu' +rescue LoadError + require "#{File.dirname(__FILE__)}/util/ubuntu" +end + +def ubuntu_codename_to_next(codename) + codenames = Facter::Util::Ubuntu::CODENAMES + i = codenames.index(codename) + if i and i+1 < codenames.count + return codenames[i+1] + end +end + +Facter.add(:ubuntu_nextcodename) do + confine :operatingsystem => 'Ubuntu' + setcode do + ubuntu_codename_to_next(Facter.value('ubuntu_codename')) + end +end |