B #1716: Check KVM_MACHINES & CPU_MODELS (#1732)

(cherry picked from commit 01981ebc5b)
This commit is contained in:
Abel Coronado authored and Tino Vazquez committed 2018-02-21 15:58:47 +01:00
1 parent f1da61e46e
commit 2cd5bf0e03
1 file changed
+12 -10
+12 -10
View File
@@ -629,24 +629,26 @@ get '/infrastructure' do
set = Set.new
if !xml['HOST/TEMPLATE/CUSTOMIZATION'].nil?
xml.each('HOST/TEMPLATE/CUSTOMIZATION') do |customization|
set.add(customization['NAME'])
end
xml.each('HOST/TEMPLATE/CUSTOMIZATION') do |customization|
set.add(customization['NAME'])
end
infrastructure[:vcenter_customizations] = set.to_a
infrastructure[:vcenter_customizations] = set.to_a
set_cpu_models = Set.new
set_kvm_machines = Set.new
set_cpu_models = Set.new
set_kvm_machines = Set.new
xml.each('HOST/TEMPLATE') do |kvm|
xml.each('HOST/TEMPLATE') do |kvm|
if !kvm['KVM_CPU_MODELS'].nil?
set_cpu_models += kvm['KVM_CPU_MODELS'].split(" ")
end
if !kvm['KVM_MACHINES'].nil?
set_kvm_machines += kvm['KVM_MACHINES'].split(" ")
end
infrastructure[:kvm_info] = { :set_cpu_models => set_cpu_models.to_a, :set_kvm_machines => set_kvm_machines.to_a }
end
infrastructure[:kvm_info] = { :set_cpu_models => set_cpu_models.to_a, :set_kvm_machines => set_kvm_machines.to_a }
[200, infrastructure.to_json]
end