def _get_runner(action_db, entry_point=None, cmd=None, on_behalf_user=None, user=None, kwarg_op=localrunner.DEFAULT_KWARG_OP, timeout=LOCAL_RUNNER_DEFAULT_ACTION_TIMEOUT, sudo=False, env=None): runner = localrunner.LocalShellRunner(uuid.uuid4().hex) runner.container_service = RunnerContainerService() runner.action = action_db runner.action_name = action_db.name runner.liveaction_id = uuid.uuid4().hex runner.entry_point = entry_point runner.runner_parameters = {localrunner.RUNNER_COMMAND: cmd, localrunner.RUNNER_SUDO: sudo, localrunner.RUNNER_ENV: env, localrunner.RUNNER_ON_BEHALF_USER: user, localrunner.RUNNER_KWARG_OP: kwarg_op, localrunner.RUNNER_TIMEOUT: timeout} runner.context = dict() runner.callback = dict() runner.libs_dir_path = None runner.auth_token = mock.Mock() runner.auth_token.token = 'mock-token' return runner
def _get_runner(self, action_db, entry_point): runner = localrunner.LocalShellRunner(uuid.uuid4().hex) runner.container_service = RunnerContainerService() runner.action = action_db runner.action_name = action_db.name runner.liveaction_id = uuid.uuid4().hex runner.entry_point = entry_point runner.runner_parameters = {} runner.context = dict() runner.callback = dict() runner.libs_dir_path = None runner.auth_token = mock.Mock() runner.auth_token.token = 'mock-token' return runner