From b8a461638eca77e2fdd82c6bf07784b0b44cc917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Wed, 29 Jun 2016 17:57:08 +0200 Subject: Always set debian_nextcodename to 'sid' on systems running testing, fixes #12 --- lib/facter/debian_nextcodename.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/facter/debian_nextcodename.rb b/lib/facter/debian_nextcodename.rb index c4c569b..654fe20 100644 --- a/lib/facter/debian_nextcodename.rb +++ b/lib/facter/debian_nextcodename.rb @@ -4,8 +4,10 @@ rescue LoadError require "#{File.dirname(__FILE__)}/util/debian" end -def debian_codename_to_next(codename) - if codename == "sid" +def debian_codename_to_next(codename, release) + if release == "testing" + return "sid" + elsif release == "unstable" return "experimental" else codenames = Facter::Util::Debian::CODENAMES @@ -18,6 +20,6 @@ end Facter.add(:debian_nextcodename) do confine :operatingsystem => 'Debian' setcode do - debian_codename_to_next(Facter.value('debian_codename')) + debian_codename_to_next(Facter.value('debian_codename'), Facter.value('debian_release')) end end -- cgit v1.2.3