generate job info from available properties in rpc. fixes #2236

git-svn-id: file:///home/svn/framework3/trunk@9902 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
James Lee 2010-07-21 08:57:11 +00:00
parent 50914a1e68
commit b8b5d0586d
2 changed files with 13 additions and 2 deletions

View File

@ -28,7 +28,19 @@ class Job < Base
if(not obj)
raise ::XMLRPC::FaultException.new(404, "no such job")
else
info = obj.info
info = {
"jid" => obj.jid,
"name" => obj.name,
"start_time" => obj.start_time
}
if obj.ctx && obj.ctx[0]
if obj.ctx[0].respond_to?(:get_resource)
info['uripath'] = obj.ctx[0].get_resource
end
if obj.ctx[0].respond_to?(:datastore)
info['datastore'] = obj.ctx[0].datastore
end
end
{ "result" => "success" , "info" => info}
end
end

View File

@ -83,7 +83,6 @@ class Job
protected
attr_writer :info #:nodoc:
attr_writer :name #:nodoc:
attr_writer :jid #:nodoc:
attr_accessor :job_thread #:nodoc: