コード例 #1
0
 def _get_failingaction_exec_db_model(self, params):
     actionexec_db = ActionExecutionDB()
     actionexec_db.status = 'initializing'
     actionexec_db.start_timestamp = datetime.datetime.now()
     actionexec_db.action = ResourceReference(
         name=RunnerContainerTest.failingaction_db.name,
         pack=RunnerContainerTest.failingaction_db.pack).ref
     actionexec_db.parameters = params
     actionexec_db.context = {'user': cfg.CONF.system_user.user}
     return actionexec_db
コード例 #2
0
 def _get_failingaction_exec_db_model(self, params):
     actionexec_db = ActionExecutionDB()
     actionexec_db.status = 'initializing'
     actionexec_db.start_timestamp = datetime.datetime.now()
     actionexec_db.action = ResourceReference(
         name=RunnerContainerTest.failingaction_db.name,
         pack=RunnerContainerTest.failingaction_db.pack).ref
     actionexec_db.parameters = params
     actionexec_db.context = {'user': cfg.CONF.system_user.user}
     return actionexec_db
コード例 #3
0
ファイル: actionchainrunner.py プロジェクト: ojacques/st2
 def _run_action(action_ref, parent_execution_id, params, wait_for_completion=True):
     execution = ActionExecutionDB(action=action_ref)
     execution.parameters = ActionChainRunner._cast_params(action_ref, params)
     execution.context = {'parent': str(parent_execution_id)}
     execution = action_service.schedule(execution)
     while (wait_for_completion and
            execution.status != ACTIONEXEC_STATUS_SUCCEEDED and
            execution.status != ACTIONEXEC_STATUS_FAILED):
         eventlet.sleep(1)
         execution = action_db_util.get_actionexec_by_id(execution.id)
     return execution
コード例 #4
0
 def _run_action(action_ref,
                 parent_execution_id,
                 params,
                 wait_for_completion=True):
     execution = ActionExecutionDB(action=action_ref)
     execution.parameters = ActionChainRunner._cast_params(
         action_ref, params)
     execution.context = {'parent': str(parent_execution_id)}
     execution = action_service.schedule(execution)
     while (wait_for_completion
            and execution.status != ACTIONEXEC_STATUS_SUCCEEDED
            and execution.status != ACTIONEXEC_STATUS_FAILED):
         eventlet.sleep(1)
         execution = action_db_util.get_actionexec_by_id(execution.id)
     return execution