Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: server/site_server_job.py

Issue 6805015: Re-adding get_site_job_data(): Now uses host platform for hostname. (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: Add a comment about all hosts sharing a platform. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os
6 import common
7 import utils
8
9
10 def get_site_job_data(job):
11 """Add custom data to the job keyval info.
12
13 When multiple machines are used in a job, change the hostname to
14 the platform of the first machine instead of machine1,machine2,... This
15 makes the job reports easier to read and keeps the tko_machines table from
16 growing too large.
17
18 Args:
19 job: instance of server_job.
20
21 Returns:
22 keyval dictionary with new hostname value, or empty dictionary.
23 """
24 site_job_data = {}
25 # Only modify hostname on multimachine jobs. Assume all host have the same
26 # platform.
27 if len(job.machines) > 1:
28 # Search through machines for first machine with a platform.
29 for host in job.machines:
30 keyval_path = os.path.join(job.resultdir, 'host_keyvals', host)
31 keyvals = utils.read_keyval(keyval_path)
32 host_plat = keyvals.get('platform', None)
33 if not host_plat:
34 continue
35 site_job_data['hostname'] = host_plat
36 break
37 return site_job_data
38
39
40 class site_server_job(object):
41 pass
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698