Make the job executiontag available in both the server and client side job
objects as job.tag.
This is useful if your job would like to copy its data off directly to a
results repository on its own from the client machine.
Mostly small changes to pass the data down, though I did some docstring
cleanup near code that I touched which makes the diff larger.
The execution tag is taken from the autoserv -P parameter if supplied
and no explicit --execution-tag parameter is supplied. This prevents
the need to change monitor_db.py to pass yet another autoserv parameter.
Signed-off-by: Gregory Smith <[email protected]>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3359 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/server_job.py b/server/server_job.py
index 8566e5e..53af0c1 100755
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -76,22 +76,24 @@
def __init__(self, control, args, resultdir, label, user, machines,
client=False, parse_job='',
ssh_user='root', ssh_port=22, ssh_pass='',
- group_name=''):
+ group_name='', tag=''):
"""
Create a server side job object.
- @param control The pathname of the control file.
- @param args Passed to the control file.
- @param resultdir Where to throw the results.
- @param label Description of the job.
- @param user Username for the job (email address).
- @param client True if this is a client-side control file.
- @param parse_job bool, should the results be through the TKO parser.
- @param ssh_user The SSH username. [root]
- @param ssh_port The SSH port number. [22]
- @param ssh_pass The SSH passphrase, if needed.
- @param group_name If supplied, this will be written out as
+ @param control: The pathname of the control file.
+ @param args: Passed to the control file.
+ @param resultdir: Where to throw the results.
+ @param label: Description of the job.
+ @param user: Username for the job (email address).
+ @param client: True if this is a client-side control file.
+ @param parse_job: string, if supplied it is the job execution tag that
+ the results will be passed through to the TKO parser with.
+ @param ssh_user: The SSH username. [root]
+ @param ssh_port: The SSH port number. [22]
+ @param ssh_pass: The SSH passphrase, if needed.
+ @param group_name: If supplied, this will be written out as
host_group_name in the keyvals file for the parser.
+ @param tag: The job execution tag from the scheduler. [optional]
"""
path = os.path.dirname(__file__)
self.autodir = os.path.abspath(os.path.join(path, '..'))
@@ -128,6 +130,7 @@
self.ssh_user = ssh_user
self.ssh_port = ssh_port
self.ssh_pass = ssh_pass
+ self.tag = tag
self.run_test_cleanup = True
self.last_boot_tag = None
self.hosts = set()
@@ -477,8 +480,8 @@
try:
shutil.rmtree(temp_control_file_dir)
except Exception, e:
- print 'Error %s removing dir %s' % (e,
- temp_control_file_dir)
+ logging.warn('Could not remove temp directory %s: %s',
+ temp_control_file_dir, e)
if machines and (collect_crashdumps or collect_crashinfo):
namespace['test_start_time'] = test_start_time