simplify and fix rpc_get_note
parent
52b9fc8fca
commit
8bd2a69112
|
@ -107,14 +107,10 @@ private
|
||||||
def get_notes(xopts)
|
def get_notes(xopts)
|
||||||
::ActiveRecord::Base.connection_pool.with_connection {
|
::ActiveRecord::Base.connection_pool.with_connection {
|
||||||
opts, wspace = init_db_opts_workspace(xopts)
|
opts, wspace = init_db_opts_workspace(xopts)
|
||||||
|
notes = []
|
||||||
ret = {}
|
|
||||||
ret[:note] = []
|
|
||||||
|
|
||||||
host = self.framework.db.get_host(opts)
|
host = self.framework.db.get_host(opts)
|
||||||
|
return notes if not host
|
||||||
return ret if not host
|
|
||||||
notes = []
|
|
||||||
|
|
||||||
if opts[:proto] && opts[:port]
|
if opts[:proto] && opts[:port]
|
||||||
services = []
|
services = []
|
||||||
|
@ -833,6 +829,9 @@ public
|
||||||
# @example Here's how you would use this from the client:
|
# @example Here's how you would use this from the client:
|
||||||
# rpc.call('db.get_note', {:proto => 'tcp', :port => 80})
|
# rpc.call('db.get_note', {:proto => 'tcp', :port => 80})
|
||||||
def rpc_get_note(xopts)
|
def rpc_get_note(xopts)
|
||||||
|
ret = {}
|
||||||
|
ret[:note] = []
|
||||||
|
|
||||||
notes = get_notes(xopts)
|
notes = get_notes(xopts)
|
||||||
|
|
||||||
notes.each do |n|
|
notes.each do |n|
|
||||||
|
|
Loading…
Reference in New Issue