[autotest] Move redirect logic to retrieve_logs.cgi

Currently retrieve_logs.cgi searches the drones for the file
requested. If its not found it returns None so then the server
checks the localhost. At that point apache will redirect to
Google Storage if the file does not exist.

This change instead has retrieve_logs.cgi first check locally
if the results file is on localhost. If not it uses the
utils.get_offload_gsuri to put together the url to Google Storage
that holds the results.

Impact:
* Removes the need for the site-misc-directives and we should
  delete that in a following CL.
* Allows moblab devices to redirect properly to Google Storage.
* 1 symptom is that local setups will point to
  gs://chromeos-autotest-results/ if the file is not found locally
  but I don't think this will be a problem.

BUG=chromium:415304
TEST=locally on my setup and on moblab.

CQ-DEPEND=CL:217822

Change-Id: I2a1e5f4c371ef6331f4822c857006a31ab490539
Reviewed-on: https://chromium-review.googlesource.com/218908
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
1 file changed