remove a debug print and default proto to 'tcp' if it wasn't given
git-svn-id: file:///home/svn/framework3/trunk@8034 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
3109ae1b53
commit
653daac8e6
|
@ -241,7 +241,8 @@ class DBManager
|
||||||
def find_or_initialize_service(opts)
|
def find_or_initialize_service(opts)
|
||||||
addr = opts.delete(:host) || return
|
addr = opts.delete(:host) || return
|
||||||
host = find_or_create_host({:host => addr})
|
host = find_or_create_host({:host => addr})
|
||||||
service = host.services.find_or_initialize_by_port_and_proto(opts[:port], opts[:proto])
|
proto = opts[:proto] || 'tcp'
|
||||||
|
service = host.services.find_or_initialize_by_port_and_proto(opts[:port], proto)
|
||||||
opts.each { |k,v|
|
opts.each { |k,v|
|
||||||
if (service.attribute_names.include?(k.to_s))
|
if (service.attribute_names.include?(k.to_s))
|
||||||
service[k] = v
|
service[k] = v
|
||||||
|
@ -422,7 +423,6 @@ class DBManager
|
||||||
data = opts[:data] || return
|
data = opts[:data] || return
|
||||||
|
|
||||||
note = workspace.notes.find_or_initialize_by_ntype_and_data(ntype, data.to_yaml)
|
note = workspace.notes.find_or_initialize_by_ntype_and_data(ntype, data.to_yaml)
|
||||||
p note
|
|
||||||
|
|
||||||
if opts[:host]
|
if opts[:host]
|
||||||
if opts[:host].kind_of? Host
|
if opts[:host].kind_of? Host
|
||||||
|
|
Loading…
Reference in New Issue