Fix debian_codename fact when falling back to parsing /etc/debian_version

This commit is contained in:
Jerome Charaoui 2015-10-09 17:12:31 -04:00
parent f8980538c1
commit 3dea5b8df7

View file

@ -32,7 +32,7 @@ Facter.add(:debian_codename) do
setcode do
debian_version = File.open('/etc/debian_version', &:readline)
if debian_version.match(/^\d+/)
version_to_codename(version_to_codename.scan(/^(\d+)/)[0][0])
version_to_codename(debian_version.scan(/^(\d+)/)[0][0])
elsif debian_version.match(/^[a-z]+\/(sid|unstable)/)
debian_version.scan(/^([a-z]+)\//)[0][0]
end