Skip to content

Commit

Permalink
client job: Adjust runjob method of loading a control file
Browse files Browse the repository at this point in the history
We had to standardize that the state files will be
always on a temp area on the autotest client, so,
let's enforce this policy on runjob.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
  • Loading branch information
lmr committed Jun 27, 2012
1 parent 2648c15 commit e9e62d5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion client/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,19 @@ def runjob(control, drop_caches, options):
@see base_job.__init__ for parameter info.
"""
control = os.path.abspath(control)
state = control + '.state'

try:
autodir = os.path.abspath(os.environ['AUTODIR'])
except KeyError:
autodir = GLOBAL_CONFIG.get_config_value('COMMON',
'autotest_top_path')

tmpdir = os.path.join(autodir, 'tmp')
tests_out_dir = GLOBAL_CONFIG.get_config_value('COMMON',
'test_output_dir',
default=tmpdir)
state = os.path.join(tests_out_dir, os.path.basename(control) + '.state')

# Ensure state file is cleaned up before the job starts to run if autotest
# is not running with the --continue flag
if not options.cont and os.path.isfile(state):
Expand Down

0 comments on commit e9e62d5

Please sign in to comment.