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

Side by Side Diff: server/server_job.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 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
OLDNEW
1 """ 1 """
2 The main job wrapper for the server side. 2 The main job wrapper for the server side.
3 3
4 This is the core infrastructure. Derived from the client side job.py 4 This is the core infrastructure. Derived from the client side job.py
5 5
6 Copyright Martin J. Bligh, Andy Whitcroft 2007 6 Copyright Martin J. Bligh, Andy Whitcroft 2007
7 """ 7 """
8 8
9 import getpass, os, sys, re, stat, tempfile, time, select, subprocess 9 import getpass, os, sys, re, stat, tempfile, time, select, subprocess, platform
10 import traceback, shutil, warnings, fcntl, pickle, logging, itertools, errno 10 import traceback, shutil, warnings, fcntl, pickle, logging, itertools, errno
11 from autotest_lib.client.bin import sysinfo 11 from autotest_lib.client.bin import sysinfo
12 from autotest_lib.client.common_lib import base_job 12 from autotest_lib.client.common_lib import base_job
13 from autotest_lib.client.common_lib import error, log, utils, packages 13 from autotest_lib.client.common_lib import error, log, utils, packages
14 from autotest_lib.client.common_lib import logging_manager 14 from autotest_lib.client.common_lib import logging_manager
15 from autotest_lib.server import test, subcommand, profilers 15 from autotest_lib.server import test, subcommand, profilers
16 from autotest_lib.server.hosts import abstract_ssh 16 from autotest_lib.server.hosts import abstract_ssh
17 from autotest_lib.tko import db as tko_db, status_lib, utils as tko_utils 17 from autotest_lib.tko import db as tko_db, status_lib, utils as tko_utils
18 18
19 19
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 self.logging = logging_manager.get_logging_manager( 198 self.logging = logging_manager.get_logging_manager(
199 manage_stdout_and_stderr=True, redirect_fds=True) 199 manage_stdout_and_stderr=True, redirect_fds=True)
200 subcommand.logging_manager_object = self.logging 200 subcommand.logging_manager_object = self.logging
201 201
202 self.sysinfo = sysinfo.sysinfo(self.resultdir) 202 self.sysinfo = sysinfo.sysinfo(self.resultdir)
203 self.profilers = profilers.profilers(self) 203 self.profilers = profilers.profilers(self)
204 204
205 job_data = {'label' : label, 'user' : user, 205 job_data = {'label' : label, 'user' : user,
206 'hostname' : ','.join(machines), 206 'hostname' : ','.join(machines),
207 'drone' : platform.node(),
207 'status_version' : str(self._STATUS_VERSION), 208 'status_version' : str(self._STATUS_VERSION),
208 'job_started' : str(int(time.time()))} 209 'job_started' : str(int(time.time()))}
209 if group_name: 210 if group_name:
210 job_data['host_group_name'] = group_name 211 job_data['host_group_name'] = group_name
211 212
212 # only write these keyvals out on the first job in a resultdir 213 # only write these keyvals out on the first job in a resultdir
213 if 'job_started' not in utils.read_keyval(self.resultdir): 214 if 'job_started' not in utils.read_keyval(self.resultdir):
214 job_data.update(get_site_job_data(self)) 215 job_data.update(get_site_job_data(self))
215 utils.write_keyval(self.resultdir, job_data) 216 utils.write_keyval(self.resultdir, job_data)
216 217
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 intervals = self.disabled_warnings.setdefault(warning_type, []) 1140 intervals = self.disabled_warnings.setdefault(warning_type, [])
1140 if not intervals or intervals[-1][1] is not None: 1141 if not intervals or intervals[-1][1] is not None:
1141 intervals.append((int(current_time_func()), None)) 1142 intervals.append((int(current_time_func()), None))
1142 1143
1143 1144
1144 def enable_warnings(self, warning_type, current_time_func=time.time): 1145 def enable_warnings(self, warning_type, current_time_func=time.time):
1145 """As of now, enables all further warnings of this type.""" 1146 """As of now, enables all further warnings of this type."""
1146 intervals = self.disabled_warnings.get(warning_type, []) 1147 intervals = self.disabled_warnings.get(warning_type, [])
1147 if intervals and intervals[-1][1] is None: 1148 if intervals and intervals[-1][1] is None:
1148 intervals[-1] = (intervals[-1][0], int(current_time_func())) 1149 intervals[-1] = (intervals[-1][0], int(current_time_func()))
OLDNEW
« cli/job.py ('K') | « server/prebuild.py ('k') | server/standalone_profiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698