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

M #-: fix minor bug (#4631)

This commit is contained in:
Alejandro Huertas Herrero 2020-04-30 11:07:33 +02:00 committed by GitHub
parent de1f9a217a
commit 776c4a2d66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ class OneDB
def initialize(ops)
if ops[:backend].nil? && CONNECTION_PARAMETERS.all? {|s| ops[s].nil? }
ops = read_credentials(ops)
elsif ops[:backend].nil? && CONNECTION_PARAMETERS.one? {|s| !ops[s].nil? }
elsif ops[:backend].nil? && CONNECTION_PARAMETERS.any? {|s| !ops[s].nil? }
# Set MySQL backend as default if any connection option is provided and --type is not
ops[:backend] = :mysql
end
@ -141,7 +141,7 @@ class OneDB
ops.each {|_, v| v.gsub!("\\", '') if v }
ops[:backend] = ops[:backend].to_sym
ops[:backend] = ops[:backend].to_sym unless ops[:backend].nil?
ops[:port] = ops[:port].to_i
ops