本文整理汇总了Python中AgentUtils.reportNonUDAShell方法的典型用法代码示例。如果您正苦于以下问题:Python AgentUtils.reportNonUDAShell方法的具体用法?Python AgentUtils.reportNonUDAShell怎么用?Python AgentUtils.reportNonUDAShell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AgentUtils
的用法示例。
在下文中一共展示了AgentUtils.reportNonUDAShell方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkUpgradeStatus
# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import reportNonUDAShell [as 别名]
def checkUpgradeStatus(Framework):
if Framework.getProperty(InventoryUtils.STATE_PROPERTY_AGENT_INSTALLED) is None:
agentId = Framework.getDestinationAttribute('agentId')
# in migration job
if agentId is None or not len(str(agentId).strip()) :
Framework.reportError(inventoryerrorcodes.INVENTORY_DISCOVERY_FAILED_AGENT_INSTALL_AFTER_UNINTALL, None)
Framework.setStepExecutionStatus(WorkflowStepStatus.FAILURE)
return
logger.debug('Old agent was uninstalled but failed to install new one. Upgrade process failed. Sending to delete UD agent object')
agentOsh = modeling.createOshByCmdbIdString(ClientsConsts.DDM_AGENT_PROTOCOL_NAME, agentId)
Framework.deleteObject(agentOsh)
logger.debug("Restore Non UDA Shell since the UDA has been removed.")
AgentUtils.reportNonUDAShell(Framework)
Framework.flushObjects()
Framework.reportError(inventoryerrorcodes.INVENTORY_DISCOVERY_FAILED_AGENT_INSTALL_AFTER_UNINTALL, None)
Framework.setStepExecutionStatus(WorkflowStepStatus.FATAL_FAILURE)
else:
logger.debug('Upgrade UDA is successful.')
Framework.setStepExecutionStatus(WorkflowStepStatus.SUCCESS)