Set execution engine parameters directly instead of using keyvals, to support cloning of the execution engine job
Signed-off-by: James Ren <[email protected]> --- autotest/frontend/planner/execution_engine_control.srv 2010-04-09 13:41:32.000000000 -0700 +++ autotest/frontend/planner/execution_engine_control.srv 2010-04-09 13:41:32.000000000 -0700 @@ -1,9 +1,6 @@ -from autotest_lib.client.common_lib import utils from autotest_lib.frontend.planner import execution_engine -keyvals = utils.read_keyval(job.resultdir) - -engine = execution_engine.ExecutionEngine(plan_id=keyvals['plan_id'], - server=keyvals['server'], - label_name=keyvals['label_name']) +engine = execution_engine.ExecutionEngine(plan_id=%(plan_id)d, + server='%(server)s', + label_name='%(label_name)s') engine.start() --- autotest/frontend/planner/rpc_utils.py 2010-04-09 10:47:04.000000000 -0700 +++ autotest/frontend/planner/rpc_utils.py 2010-04-09 13:41:32.000000000 -0700 @@ -38,12 +38,12 @@ """ timeout = global_config.global_config.get_config_value( 'PLANNER', 'execution_engine_timeout') - keyvals = {'server': SERVER, - 'plan_id': plan.id, - 'label_name': label.name} + control = _get_execution_engine_control(server=SERVER, + plan_id=plan.id, + label_name=label.name) options = {'name': plan.name + '_execution_engine', 'priority': afe_models.Job.Priority.MEDIUM, - 'control_file': _get_execution_engine_control(), + 'control_file': control, 'control_type': afe_models.Job.ControlType.SERVER, 'synch_count': None, 'timeout': timeout, @@ -58,12 +58,13 @@ job.queue(hosts=()) -def _get_execution_engine_control(): +def _get_execution_engine_control(server, plan_id, label_name): """ Gets the control file to run the execution engine """ - return lazy_load(os.path.join(os.path.dirname(__file__), - 'execution_engine_control.srv')) + control = lazy_load(os.path.join(os.path.dirname(__file__), + 'execution_engine_control.srv')) + return control % dict(server=server, plan_id=plan_id, label_name=label_name) def lazy_load(path): _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
