Fix up parse so it can reparse a job - allows continuous status
Signed-off-by: Martin Bligh <mbligh@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1087 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/autoserv b/server/autoserv
index 426ec39..401ace2 100755
--- a/server/autoserv
+++ b/server/autoserv
@@ -80,12 +80,12 @@
sys.exit(0)
job = server_job.server_job(parser.args[0], parser.args[1:], results, label,
- user, client)
+ user, machines, client)
job.stdout.tee_redirect(os.path.join(results, 'debug', 'autoserv.stdout'))
job.stderr.tee_redirect(os.path.join(results, 'debug', 'autoserv.stderr'))
try:
- job.run(machines, reboot, install_before, install_after)
+ job.run(reboot, install_before, install_after)
except:
traceback.print_exc()
diff --git a/server/server_job.py b/server/server_job.py
index 637bc20..5a8532b 100755
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -135,7 +135,8 @@
the control file for this job
"""
- def __init__(self, control, args, resultdir, label, user, client=False):
+ def __init__(self, control, args, resultdir, label, user, machines,
+ client = False):
"""
control
The control file (pathname of)
@@ -168,6 +169,7 @@
self.label = label
self.user = user
self.args = args
+ self.machines = machines
self.client = client
self.record_prefix = ''
@@ -176,14 +178,16 @@
if os.path.exists(self.status):
os.unlink(self.status)
- job_data = { 'label' : label, 'user' : user}
+ job_data = { 'label' : label, 'user' : user,
+ 'hostname' : ','.join(machines) }
write_keyval(self.resultdir, job_data)
- def run(self, machines, reboot = False, install_before = False,
+ def run(self, reboot = False, install_before = False,
install_after = False, namespace = {}):
# use a copy so changes don't affect the original dictionary
namespace = namespace.copy()
+ machines = self.machines
self.aborted = False
namespace['machines'] = machines