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-b9f4589650da
unstable
James Lee 2009-12-30 17:43:47 +00:00
parent 3109ae1b53
commit 653daac8e6
1 changed files with 2 additions and 2 deletions

View File

@ -241,7 +241,8 @@ class DBManager
def find_or_initialize_service(opts)
addr = opts.delete(:host) || return
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|
if (service.attribute_names.include?(k.to_s))
service[k] = v
@ -422,7 +423,6 @@ class DBManager
data = opts[:data] || return
note = workspace.notes.find_or_initialize_by_ntype_and_data(ntype, data.to_yaml)
p note
if opts[:host]
if opts[:host].kind_of? Host