1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

feature #3356: Add description (from VM Notes) and logo for common OS

(cherry picked from commit f2c71cfdedaab9d516223cea0e64ef9327463d3a)
This commit is contained in:
Ruben S. Montero 2015-01-09 18:25:44 +01:00
parent daf201e809
commit 2fb533cf23

View File

@ -897,6 +897,33 @@ class VCenterVm
" LISTEN =\"0.0.0.0\"\n"\
"]\n"\
"SCHED_REQUIREMENTS=\"NAME=\\\"#{@vm.runtime.host.parent.name}\\\"\"\n"
if @vm.config.annotation.nil? || @vm.config.annotation.empty?
str << "DESCRIPTION = \"vCenter Template imported by OpenNebula"\
" from Cluster #{@vm.runtime.host.parent.name}\""
else
notes = @vm.config.annotation.gsub("\\", "\\\\").gsub("\"", "\\\"")
str << "DESCRIPTION = \"#{notes}\""
end
case @vm.guest.guestFullName
when /CentOS/i
str << "LOGO=images/logos/centos.png"
when /Debian/i
str << "LOGO=images/logos/debian.png"
when /Red Hat/i
str << "LOGO=images/logos/redhat.png"
when /Ubuntu/i
str << "LOGO=images/logos/ubuntu.png"
when /Windows XP/i
str << "LOGO=images/logos/windowsxp.png"
when /Windows/i
str << "LOGO=images/logos/windows8.png"
when /Linux/i
str << "LOGO=images/logos/linux.png"
end
return str
end
private