Allow report_auth_info() to accept a Host object instead of an address like all the other methods.
git-svn-id: file:///home/svn/framework3/trunk@12415 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
9d715a1492
commit
5918e6c0ac
|
@ -892,7 +892,7 @@ class DBManager
|
|||
# report_vuln() now.
|
||||
#
|
||||
# opts must contain
|
||||
# :host -- an IP address
|
||||
# :host -- an IP address or Host object reference
|
||||
# :port -- a port number
|
||||
#
|
||||
# opts can contain
|
||||
|
@ -917,8 +917,12 @@ class DBManager
|
|||
def report_auth_info(opts={})
|
||||
return if not active
|
||||
raise ArgumentError.new("Missing required option :host") if opts[:host].nil?
|
||||
raise ArgumentError.new("Invalid address for :host") unless validate_ips(opts[:host])
|
||||
raise ArgumentError.new("Missing required option :port") if opts[:port].nil?
|
||||
|
||||
if opts[:host].kind_of?(Host) or validate_ips(opts[:host])
|
||||
raise ArgumentError.new("Invalid address or object for :host")
|
||||
end
|
||||
|
||||
host = opts.delete(:host)
|
||||
ptype = opts.delete(:type) || "password"
|
||||
token = [opts.delete(:user), opts.delete(:pass)]
|
||||
|
|
Loading…
Reference in New Issue