Beispiel #1
0
    def _clean_db(self):
        lookup_utils.clear_caches()

        contexts = [get_context(default=False), get_context(default=True)]

        for ctx in contexts:
            auth_context.set_ctx(ctx)

            with mock.patch('mistral.services.security.get_project_id',
                            new=mock.MagicMock(return_value=ctx.project_id)):
                with db_api.transaction():
                    db_api.delete_event_triggers()
                    db_api.delete_cron_triggers()
                    db_api.delete_workflow_executions()
                    db_api.delete_task_executions()
                    db_api.delete_action_executions()
                    db_api.delete_workbooks()
                    db_api.delete_workflow_definitions()
                    db_api.delete_environments()
                    db_api.delete_resource_members()
                    db_api.delete_delayed_calls()
                    db_api.delete_scheduled_jobs()

        sqlite_lock.cleanup()

        if not cfg.CONF.database.connection.startswith('sqlite'):
            db_sa_base.get_engine().dispose()
Beispiel #2
0
    def _clean_db(self):
        contexts = [
            get_context(default=False),
            get_context(default=True)
        ]

        for ctx in contexts:
            auth_context.set_ctx(ctx)

            with mock.patch('mistral.services.security.get_project_id',
                            new=mock.MagicMock(return_value=ctx.project_id)):
                with db_api.transaction():
                    db_api.delete_event_triggers()
                    db_api.delete_cron_triggers()
                    db_api.delete_workflow_executions()
                    db_api.delete_task_executions()
                    db_api.delete_action_executions()
                    db_api.delete_workbooks()
                    db_api.delete_workflow_definitions()
                    db_api.delete_environments()
                    db_api.delete_resource_members()

        sqlite_lock.cleanup()

        if not cfg.CONF.database.connection.startswith('sqlite'):
            db_sa_base.get_engine().dispose()
Beispiel #3
0
    def _clean_db(self):
        with db_api_v2.transaction():
            db_api_v2.delete_workbooks()
            db_api_v2.delete_executions()
            db_api_v2.delete_cron_triggers()
            db_api_v2.delete_workflow_definitions()

        sqlite_lock.cleanup()
Beispiel #4
0
    def _clean_db(self):
        contexts = [get_context(default=False), get_context(default=True)]

        for ctx in contexts:
            auth_context.set_ctx(ctx)

            with mock.patch('mistral.services.security.get_project_id',
                            new=mock.MagicMock(return_value=ctx.project_id)):
                with db_api_v2.transaction():
                    db_api_v2.delete_executions()
                    db_api_v2.delete_workbooks()
                    db_api_v2.delete_cron_triggers()
                    db_api_v2.delete_workflow_definitions()
                    db_api_v2.delete_environments()

        sqlite_lock.cleanup()

        if not cfg.CONF.database.connection.startswith('sqlite'):
            db_sa_base.get_engine().dispose()
Beispiel #5
0
def _clear_system_workflow_db():
    db_api.delete_workflow_definitions(is_system=True)
Beispiel #6
0
def _clear_system_workflow_db():
    db_api.delete_workflow_definitions(is_system=True)