diff options
author | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-09-11 18:41:07 +0000 |
---|---|---|
committer | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-09-11 18:41:07 +0000 |
commit | 9f3cebb66ca51262af5e527bfcea687c19e7dac6 (patch) | |
tree | a283de41a3228298200e8519365580bafa3dd141 /tko | |
parent | a18b8506b134d83f3ce60c00699eda4e5167475a (diff) |
fix jsonp_fetcher, it was broken by changes to ServiceHandler in previous patch to implement RPC logging
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@3706 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko')
-rwxr-xr-x | tko/jsonp_fetcher.cgi | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tko/jsonp_fetcher.cgi b/tko/jsonp_fetcher.cgi index 75ac84aa..ffb4d65b 100755 --- a/tko/jsonp_fetcher.cgi +++ b/tko/jsonp_fetcher.cgi @@ -1,6 +1,6 @@ #!/usr/bin/python -import cgi, urllib2 +import cgi, traceback, urllib2 import common from autotest_lib.frontend.afe.json_rpc import serviceHandler @@ -21,13 +21,13 @@ request = serviceHandler.ServiceHandler.translateRequest(encoded_request) parameters = request['params'][0] path = parameters['path'] -result, error = None, None +result_dict = serviceHandler.ServiceHandler.blank_result_dict() try: file_contents = urllib2.urlopen('http://localhost' + path).read() - result = file_contents + result_dict['result'] = file_contents except urllib2.HTTPError: - error = LogFileNotFound('%s not found' % path) + result_dict['err'] = LogFileNotFound('%s not found' % path) + result_dict['err_traceback'] = traceback.format_exc() -encoded_result = serviceHandler.ServiceHandler.translateResult(result, error, - None, None) +encoded_result = serviceHandler.ServiceHandler.translateResult(result_dict) print script % dict(callback=callback, result=encoded_result) |