Merge "fix getting the release name with lsb release"

This commit is contained in:
Jenkins 2014-02-10 22:59:59 +00:00 committed by Gerrit Code Review
commit 9d4234aaf5

@ -55,22 +55,19 @@ when 'rhel'
when 'suse' when 'suse'
if node['lsb']['description'].nil? if node['lsb']['description'].nil?
# Workaround for SLE11 # Ohai lsb does not work at all on SLES11SP3
# # See https://tickets.opscode.com/browse/OHAI-454
# On SLE11 ohai is broken and prefers lsb-release. We need to # Until then, copy chef's lsb_release parsing code from its lsb module.
# install it to be able to detect if recipe is run on openSUSE or SLES. package 'lsb-release'
#
# https://bugzilla.novell.com/show_bug.cgi?id=809129 Mixlib::ShellOut.new('lsb_release -a').run_command.stdout.split("\n").each do |line|
# case line
# when /^Description:\s+(.+)$/
install_lsb_release = package 'lsb-release' do node.set_unless['lsb']['description'] = Regexp.last_match[1]
action :nothing when /^Release:\s+(.+)$/
node.set_unless['lsb']['release'] = Regexp.last_match[1]
end end
reload_ohai = ohai 'reload_lsb' do
action :nothing
end end
install_lsb_release.run_action(:install)
reload_ohai.run_action(:reload)
end end
if node['lsb']['description'][/^SUSE Linux Enterprise Server/] if node['lsb']['description'][/^SUSE Linux Enterprise Server/]
release, patchlevel = node['platform_version'].split('.') release, patchlevel = node['platform_version'].split('.')