def checkAgentUnInstalledRoutine(Framework): Framework.setStepExecutionStatus(WorkflowStepStatus.FAILURE) protocolName = Framework.getProperty( InventoryUtils.STATE_PROPERTY_CONNECTED_SHELL_PROTOCOL_NAME) logger.debug('Protocal name: ', protocolName) if protocolName != ClientsConsts.DDM_AGENT_PROTOCOL_NAME: # Wait for 5 secs to let agent to be uninstalled. time.sleep(5) errorCode = AgentUtils.getUninstallErrorCode(Framework) if errorCode: if errorCode.isSuccess(): logger.debug('Agent is uninstalled!!!!') Framework.setStepExecutionStatus(WorkflowStepStatus.SUCCESS) elif errorCode.isInProgress(): logger.debug( 'Can not get error code from agent. Maybe the UDA is uninstalling. It will check again after parking.' ) else: logger.debug( 'Failed to uninstall agent according to error code.') Framework.setStepExecutionStatus( WorkflowStepStatus.FATAL_FAILURE) Framework.reportError(errorCode.getMessage()) else: logger.debug( 'Can not get error code now. It will check again after parking.' ) else: logger.debug( 'The connected credential is UDA. Maybe the UDA is uninstalling. It will check again after parking.' )
def checkAgentUnInstalledRoutine(Framework): Framework.setStepExecutionStatus(WorkflowStepStatus.FAILURE) protocolName = Framework.getProperty(InventoryUtils.STATE_PROPERTY_CONNECTED_SHELL_PROTOCOL_NAME) logger.debug('Protocal name: ', protocolName) if protocolName != ClientsConsts.DDM_AGENT_PROTOCOL_NAME: # Wait for 5 secs to let agent to be uninstalled. time.sleep(5) errorCode = AgentUtils.getUninstallErrorCode(Framework) if errorCode: if errorCode.isSuccess(): logger.debug('Agent is uninstalled!!!!') Framework.setStepExecutionStatus(WorkflowStepStatus.SUCCESS) elif errorCode.isInProgress(): logger.debug('Can not get error code from agent. Maybe the UDA is uninstalling. It will check again after parking.') else: logger.debug('Failed to uninstall agent according to error code.') Framework.setStepExecutionStatus(WorkflowStepStatus.FATAL_FAILURE) Framework.reportError(errorCode.getMessage()) else: logger.debug('Can not get error code now. It will check again after parking.') else: logger.debug('The connected credential is UDA. Maybe the UDA is uninstalling. It will check again after parking.')