summaryrefslogtreecommitdiff
path: root/tko
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2009-12-02 19:02:28 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2009-12-02 19:02:28 +0000
commit8494a701fcc9402b3f4dff5d0db2eddf7f6dd16a (patch)
tree5d478c36f722d93a24b44a46ede39c0db08c76f8 /tko
parent5f818cbc027688ba3d5388b49f71ff442e79ff96 (diff)
Update retrieve_logs to call the site_find_repository even if the results server is localhost. There is no reason why we can't have an additional remote repo with a localhost results server.
Signed-off-by: Scott Zawalski <scottz@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3989 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko')
-rwxr-xr-xtko/retrieve_logs.cgi41
1 files changed, 22 insertions, 19 deletions
diff --git a/tko/retrieve_logs.cgi b/tko/retrieve_logs.cgi
index dc9b8bb1..e4b5b2e7 100755
--- a/tko/retrieve_logs.cgi
+++ b/tko/retrieve_logs.cgi
@@ -46,25 +46,28 @@ def find_repository_host(job_path):
config = global_config.global_config
drones = config.get_config_value('SCHEDULER', 'drones')
results_host = config.get_config_value('SCHEDULER', 'results_host')
- drone_list = [hostname.strip() for hostname in drones.split(',')]
- results_repos = [results_host] + drone_list
- if results_repos != ['localhost']:
- for drone in results_repos:
- http_path = 'http://%s%s' % (drone, job_path)
- try:
- utils.urlopen(http_path)
- if drone == 'localhost':
- return None
- return drone
- except urllib2.URLError:
- pass
- site_host = site_find_repository_host(log_path)
- if site_host:
- return site_host
- # just return the results repo if we haven't found any
- return results_host
- else:
- return None
+ archive_host = config.get_config_value('SCHEDULER', 'archive_host',
+ default='')
+ results_repos = [results_host]
+ for drone in drones.split(','):
+ drone = drone.strip()
+ if drone not in results_repos:
+ results_repos.append(drone)
+
+ if archive_host and archive_host not in results_repos:
+ results_repos.append(archive_host)
+
+ for drone in results_repos:
+ if drone == 'localhost':
+ continue
+ http_path = 'http://%s%s' % (drone, job_path)
+ try:
+ utils.urlopen(http_path)
+ return drone
+ except urllib2.URLError:
+ pass
+
+ return site_find_repository_host(log_path)
def get_full_url(host, path):