def _get_runner(action_db, entry_point=None, cmd=None, on_behalf_user=None, user=None, kwarg_op=local_runner.DEFAULT_KWARG_OP, timeout=LOCAL_RUNNER_DEFAULT_ACTION_TIMEOUT, sudo=False, env=None): runner = local_runner.LocalShellRunner(uuid.uuid4().hex) runner.container_service = RunnerContainerService() runner.execution = MOCK_EXECUTION runner.action = action_db runner.action_name = action_db.name runner.liveaction_id = uuid.uuid4().hex runner.entry_point = entry_point runner.runner_parameters = { local_runner.RUNNER_COMMAND: cmd, local_runner.RUNNER_SUDO: sudo, local_runner.RUNNER_ENV: env, local_runner.RUNNER_ON_BEHALF_USER: user, local_runner.RUNNER_KWARG_OP: kwarg_op, local_runner.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 = local_runner.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