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


Python AgentUtils.getUpgradeErrorCode方法代码示例

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


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

示例1: CheckInstallErrorCode

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import getUpgradeErrorCode [as 别名]
def CheckInstallErrorCode(Framework):
    if AgentUtils.isUpgradeProcess(Framework):
        if AgentUtils.isUpgradeByUDAgent(Framework):
            client = Framework.getConnectedClient()
            agentVersion = client.getVersion()
            logger.debug("The current agent version is:", agentVersion)

            connectedUDACredentialId = client.getCredentialId()
            logger.debug('Credential id on remote:', connectedUDACredentialId)

            installCredentialId = Framework.getParameter(AgentUtils.UDAGENT_CONNECT_CREDENTIAL_ID_PARAM)
            logger.debug('Credential id for upgrade:', installCredentialId)

            if not AgentUtils.versionsEqual(Framework, agentVersion) or (installCredentialId
                                                                         and installCredentialId != connectedUDACredentialId):
                logger.debug("Notice: The connected client is still old UDA.")
        errorCode = AgentUtils.getUpgradeErrorCode(Framework)
    else:
        errorCode = AgentUtils.getInstallErrorCode(Framework)
    if errorCode:
        if errorCode.isSuccess():
            Framework.setProperty(CheckAgentInstalled.FIRST_TRY_INSTALL_AGENT,
                                  CheckAgentInstalled.FIRST_TRY_INSTALL_AGENT)
            Framework.setStepExecutionStatus(WorkflowStepStatus.SUCCESS)
        elif errorCode.isInProgress():
            logger.debug('UDA install command is in progress, will check after parking')
            Framework.setStepExecutionStatus(WorkflowStepStatus.FAILURE)
        else:
            logger.debug('Failed to install UDA according to install error code.')
            Framework.reportError("Install/Upgrade UDA failed. Reason is:%s" % errorCode.getMessage())
            Framework.setStepExecutionStatus(WorkflowStepStatus.FATAL_FAILURE)
    else:
        logger.debug('Can not get error code now, will check after parking')
        Framework.setStepExecutionStatus(WorkflowStepStatus.FAILURE)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:36,代码来源:CheckInstallErrorCode.py


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