本文整理汇总了Python中AgentUtils.agentUnInstallRoutine方法的典型用法代码示例。如果您正苦于以下问题:Python AgentUtils.agentUnInstallRoutine方法的具体用法?Python AgentUtils.agentUnInstallRoutine怎么用?Python AgentUtils.agentUnInstallRoutine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AgentUtils
的用法示例。
在下文中一共展示了AgentUtils.agentUnInstallRoutine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unInstallAgent
# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import agentUnInstallRoutine [as 别名]
def unInstallAgent(Framework):
protocolName = Framework.getProperty(InventoryUtils.STATE_PROPERTY_CONNECTED_SHELL_PROTOCOL_NAME)
logger.debug('Protocal name: ', protocolName)
client = Framework.getConnectedClient()
uduid = InventoryUtils.getUduid(client)
logger.debug('UD_UNIQUE_ID: ', uduid)
Framework.setProperty(InventoryUtils.ATTR_UD_UNIQUE_ID, uduid)
if protocolName == ClientsConsts.DDM_AGENT_PROTOCOL_NAME:
# Should release lock first if there will be no connected credential after agent uninstallation.
logger.debug('The connected credential is UDA. Try to release lock first.')
LockUtils.releaseScannerLock(Framework)
if AgentUtils.isAgentInstalled(Framework):
logger.debug('There is an agent in remote machine.')
# Run uninstall command.
shouldStop = AgentUtils.agentUnInstallRoutine(Framework)
if shouldStop != 0:
Framework.setStepExecutionStatus(WorkflowStepStatus.FATAL_FAILURE)
logger.debug('Failed to uninstall agent.')
else:
logger.debug('There is no agent in remote machine. The job will be done.')
reason = 'There is no agent in remote machine'
Framework.setProperty(InventoryUtils.generateSkipStep('Check Agent UnInstalled'), reason)
Framework.setStepExecutionStatus(WorkflowStepStatus.SUCCESS)