fix error

This commit is contained in:
邱博亞 2021-11-20 23:06:16 +08:00
parent 70f7e48749
commit e71936ab4d
1 changed files with 6 additions and 6 deletions

View File

@ -245,25 +245,25 @@ if bundle_update_flag
r.each do |mode,v1| r.each do |mode,v1|
v1.each do |clients,d| v1.each do |clients,d|
d.each do |k,v| d.each do |k,v|
if v["username"].present? if !v["username"].nil?
if !v["options"].present? if v["options"].nil?
v["options"] = {} v["options"] = {}
end end
v["options"]["user"] = v["username"] v["options"]["user"] = v["username"]
v.delete "username" v.delete "username"
end end
if v["password"].present? if !v["password"].nil?
if !v["options"].present? if !v["options"].nil?
v["options"] = {} v["options"] = {}
end end
v["options"]["password"] = v["password"] v["options"]["password"] = v["password"]
v.delete "password" v.delete "password"
end end
if v["options"].present? && v["options"]["pool_size"].present? if !v["options"].nil? && !v["options"]["pool_size"].nil?
v["options"]["max_pool_size"] = v["options"]["pool_size"] v["options"]["max_pool_size"] = v["options"]["pool_size"]
v["options"].delete "pool_size" v["options"].delete "pool_size"
end end
if v["options"].present? && v["options"]["read"].class == String if !v["options"].nil? && v["options"]["read"].class == String
v["options"]["read"] = {mode: v["options"]["read"]} v["options"]["read"] = {mode: v["options"]["read"]}
end end
end end