1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

L #-: Revert to_h changes

not compatible with ruby 2.0.0/centos7

(cherry picked from commit 1711fac8e1)
This commit is contained in:
Tino Vazquez 2021-06-22 18:52:47 +02:00
parent a369885f13
commit 91ef3d0fe9
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
3 changed files with 6 additions and 3 deletions

View File

@ -560,6 +560,9 @@ Layout/MultilineOperationIndentation:
# STYLE
#######
Style/HashConversion:
Enabled: false
Style/QuotedSymbols:
Enabled: false

View File

@ -249,7 +249,7 @@ class InstanceCache
def select_vms
vms = []
execute_retry('SELECT * from vms').each do |vm|
vm = [:uuid, :id, :name, :state, :type].zip(vm).to_h
vm = Hash[[:uuid, :id, :name, :state, :type].zip(vm)]
vm[:deploy_id] = vm[:uuid]
vms << vm
end

View File

@ -484,7 +484,7 @@ module OneCfg::Config::Type
elsif value.is_a?(Array)
value.collect {|v| unsymbolize(v) }
elsif value.is_a?(Hash)
value.collect {|k, v| [unsymbolize(k), unsymbolize(v)] }.to_h
Hash[value.collect {|k, v| [unsymbolize(k), unsymbolize(v)] }]
else
value
end
@ -505,7 +505,7 @@ module OneCfg::Config::Type
elsif value.is_a?(Array)
value.collect {|v| symbolize(v) }
elsif value.is_a?(Hash)
value.collect {|k, v| [symbolize(k), symbolize(v)] }.to_h
Hash[value.collect {|k, v| [symbolize(k), symbolize(v)] }]
else
value
end