1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

bug #3660: Fix OneGate format for different ruby versions

This commit is contained in:
Daniel Molina 2015-03-09 12:24:20 +01:00
parent 45081dd261
commit 41e2fa69a0

View File

@ -147,7 +147,7 @@ def build_vm_hash(vm_hash)
if vm_hash["TEMPLATE"]["NIC"]
[vm_hash["TEMPLATE"]["NIC"]].flatten.each do |nic|
nics << nic.select{|k,v| NIC_VALID_KEYS.include?(k)}
nics << Hash[nic.select{|k,v| NIC_VALID_KEYS.include?(k)}]
end
end
@ -155,9 +155,9 @@ def build_vm_hash(vm_hash)
"VM" => {
"NAME" => vm_hash["NAME"],
"ID" => vm_hash["ID"],
"USER_TEMPLATE" => vm_hash["USER_TEMPLATE"].select {|k,v|
"USER_TEMPLATE" => Hash[vm_hash["USER_TEMPLATE"].select {|k,v|
!USER_TEMPLATE_INVALID_KEYS.include?(k)
},
}],
"TEMPLATE" => {
"NIC" => nics
}