diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-10-09 12:08:26 -0400 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-10-09 12:08:26 -0400 |
commit | e4d777e5ec333c819a6b87b5c0186f67e86361ee (patch) | |
tree | b36957b74b417e68e9c09bf5300957d2e9f4857e /lib/facter/ubuntu_nextcodename.rb | |
parent | cc53ce119f5b9b239bc1b8cdcaae6a668b8d1f8c (diff) | |
parent | 3a7dd605e344cd8bdfa33a1fb82bfefe948cbd00 (diff) | |
download | puppet-apt-e4d777e5ec333c819a6b87b5c0186f67e86361ee.tar.gz puppet-apt-e4d777e5ec333c819a6b87b5c0186f67e86361ee.tar.bz2 |
Fix merge conflict in README
Diffstat (limited to 'lib/facter/ubuntu_nextcodename.rb')
-rw-r--r-- | lib/facter/ubuntu_nextcodename.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/facter/ubuntu_nextcodename.rb b/lib/facter/ubuntu_nextcodename.rb new file mode 100644 index 0000000..38b64ad --- /dev/null +++ b/lib/facter/ubuntu_nextcodename.rb @@ -0,0 +1,18 @@ +begin + require 'facter/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 |