예제 #1
0
 def _update_state_models(cls):
     states = ResultsTrackerTests.states
     state1 = ActionExecutionState.get_by_id(states['state1.yaml'].id)
     state1.execution_id = ResultsTrackerTests.liveactions['liveaction1.yaml'].id
     state2 = ActionExecutionState.get_by_id(states['state2.yaml'].id)
     state2.execution_id = ResultsTrackerTests.liveactions['liveaction2.yaml'].id
     ResultsTrackerTests.states['state1.yaml'] = ActionExecutionState.add_or_update(state1)
     ResultsTrackerTests.states['state2.yaml'] = ActionExecutionState.add_or_update(state2)
 def _update_state_models(cls):
     states = ResultsTrackerTests.states
     state1 = ActionExecutionState.get_by_id(states['state1.yaml'].id)
     state1.execution_id = ResultsTrackerTests.liveactions['liveaction1.yaml'].id
     state2 = ActionExecutionState.get_by_id(states['state2.yaml'].id)
     state2.execution_id = ResultsTrackerTests.liveactions['liveaction2.yaml'].id
     ResultsTrackerTests.states['state1.yaml'] = ActionExecutionState.add_or_update(state1)
     ResultsTrackerTests.states['state2.yaml'] = ActionExecutionState.add_or_update(state2)
예제 #3
0
def setup_query(liveaction_id, runnertype_db, query_context):
    if not getattr(runnertype_db, 'query_module', None):
        raise Exception('The runner "%s" does not have a query module.' %
                        runnertype_db.name)

    state_db = ActionExecutionStateDB(execution_id=liveaction_id,
                                      query_module=runnertype_db.query_module,
                                      query_context=query_context)

    ActionExecutionState.add_or_update(state_db)
예제 #4
0
파일: queries.py 프로젝트: StackStorm/st2
def setup_query(liveaction_id, runnertype_db, query_context):
    if not getattr(runnertype_db, 'query_module', None):
        raise Exception('The runner "%s" does not have a query module.' % runnertype_db.name)

    state_db = ActionExecutionStateDB(
        execution_id=liveaction_id,
        query_module=runnertype_db.query_module,
        query_context=query_context
    )

    ActionExecutionState.add_or_update(state_db)
예제 #5
0
파일: base.py 프로젝트: pixelrebel/st2
 def _create_execution_state(self, liveaction_id, runnertype_db, query_context):
     state_db = ActionExecutionStateDB(
         execution_id=liveaction_id, query_module=runnertype_db.query_module, query_context=query_context
     )
     try:
         return ActionExecutionState.add_or_update(state_db)
     except:
         LOG.exception("Unable to create execution state db for liveaction_id %s." % liveaction_id)
         return None
예제 #6
0
 def _create_execution_state(self, liveaction_id, runnertype_db, query_context):
     state_db = ActionExecutionStateDB(
         execution_id=liveaction_id,
         query_module=runnertype_db.query_module,
         query_context=query_context)
     try:
         return ActionExecutionState.add_or_update(state_db)
     except:
         LOG.exception('Unable to create execution state db for liveaction_id %s.'
                       % liveaction_id)
         return None
예제 #7
0
 def _create_save_actionstate():
     created = ActionExecutionStateDB()
     created.query_context = {'id': 'some_external_service_id'}
     created.query_module = 'dummy.modules.query1'
     created.execution_id = bson.ObjectId()
     return ActionExecutionState.add_or_update(created)
 def get_state(cls, exec_db):
     state = ActionExecutionStateDB(execution_id=str(exec_db.id),
                                    query_context={'id': 'foo'},
                                    query_module='test_querymodule')
     return ActionExecutionState.add_or_update(state)
예제 #9
0
 def get_state(cls, exec_db):
     state = ActionExecutionStateDB(execution_id=str(exec_db.id), query_context={'id': 'foo'},
                                    query_module='test_querymodule')
     return ActionExecutionState.add_or_update(state)