当前位置: 首页>>代码示例>>Python>>正文


Python LiveAction.delete方法代码示例

本文整理汇总了Python中st2common.persistence.liveaction.LiveAction.delete方法的典型用法代码示例。如果您正苦于以下问题:Python LiveAction.delete方法的具体用法?Python LiveAction.delete怎么用?Python LiveAction.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在st2common.persistence.liveaction.LiveAction的用法示例。


在下文中一共展示了LiveAction.delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _purge_action_models

# 需要导入模块: from st2common.persistence.liveaction import LiveAction [as 别名]
# 或者: from st2common.persistence.liveaction.LiveAction import delete [as 别名]
def _purge_action_models(execution_db):
    liveaction_id = execution_db.liveaction['id']

    if not liveaction_id:
        print('Invalid LiveAction id. Skipping delete: %s', execution_db)

    liveaction_db = None
    try:
        liveaction_db = LiveAction.get_by_id(liveaction_id)
    except:
        print('LiveAction with id: %s not found. Skipping delete.', liveaction_id)
    else:
        global DELETED_COUNT
        DELETED_COUNT += 1

    try:
        ActionExecution.delete(execution_db)
    except Exception as e:
        print('Exception deleting Execution model: %s, exception: %s',
              execution_db, str(e))
    else:
        try:
            LiveAction.delete(liveaction_db)
        except Exception as e:
            print('Zombie LiveAction left in db: %s. Exception: %s',
                  liveaction_db, str(e))
开发者ID:Kailashkatheth1,项目名称:st2,代码行数:28,代码来源:purge_executions.py

示例2: _purge_models

# 需要导入模块: from st2common.persistence.liveaction import LiveAction [as 别名]
# 或者: from st2common.persistence.liveaction.LiveAction import delete [as 别名]
def _purge_models(execution_db):
    liveaction_id = execution_db.liveaction.get("id", None)

    if not liveaction_id:
        LOG.error("Invalid LiveAction id. Skipping delete: %s", execution_db)

    liveaction_db = None
    try:
        liveaction_db = LiveAction.get_by_id(liveaction_id)
    except:
        LOG.exception("LiveAction with id: %s not found. Skipping delete.", liveaction_id)
    else:
        global DELETED_COUNT
        DELETED_COUNT += 1

    try:
        ActionExecution.delete(execution_db)
    except:
        LOG.exception("Exception deleting Execution model: %s", execution_db)
    else:
        if liveaction_db:
            try:
                LiveAction.delete(liveaction_db)
            except:
                LOG.exception("Zombie LiveAction left in db: %s.", liveaction_db)
开发者ID:beryah,项目名称:st2,代码行数:27,代码来源:purge_executions.py

示例3: _cleanup_liveaction

# 需要导入模块: from st2common.persistence.liveaction import LiveAction [as 别名]
# 或者: from st2common.persistence.liveaction.LiveAction import delete [as 别名]
def _cleanup_liveaction(liveaction):
    try:
        LiveAction.delete(liveaction)
    except:
        LOG.exception('Failed cleaning up LiveAction: %s.', liveaction)
        pass
开发者ID:jonico,项目名称:st2,代码行数:8,代码来源:action.py


注:本文中的st2common.persistence.liveaction.LiveAction.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。