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


Python AgentUtils.setUdAgentProtocolForMigration方法代码示例

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


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

示例1: connectToRemoteNode

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import setUdAgentProtocolForMigration [as 别名]
def connectToRemoteNode(Framework):
    if AgentUtils.isMigrateNeeded(Framework):
        #setting connected client identifier
        #using host name since uduid is stored in agent options and on old and new ddmi agent their location is different
        logger.debug('Connected using uda.')
        client = Framework.getConnectedClient()
        sysInfo = client.getSysInfo()
        hostName = sysInfo.getProperty('computerName')
        Framework.setProperty(InventoryUtils.UD_HOSTNAME, hostName)
        AgentUtils.setUdAgentProtocolForMigration(Framework, client.getCredentialId())
        logger.debug('Migrate is going to be performed')
        if client.hasShell():
            logger.debug('The connected Agent already supports shell, assume it is a non-native agent.')
            reason = 'The connected Agent already supports shell,it may be a non-native agent.'
            Framework.setProperty(InventoryUtils.generateSkipStep('Install Non-Native UD Agent'), reason)
            #Framework.setProperty(InventoryUtils.generateSkipStep('Check Non-Native Agent Installed'), reason)

            platform = Framework.getProperty(InventoryUtils.STATE_PROPERTY_PLATFORM)
            if platform == 'windows':
                # In windows, it is native already if it has shell.
                logger.debug('This is windows, it must be native agent.')
                Framework.setProperty(AgentUtils.DOWNLOAD_MIGRATE_LOG_FILE, '')
                reason = 'Native installation is used for Windows platform.'
                Framework.setProperty(InventoryUtils.generateSkipStep('Init Update from Non-Native to Native'), reason)
                Framework.setProperty(InventoryUtils.generateSkipStep('Install Native UD Agent'), reason)
        else:
            logger.debug('The connected client does NOT support the shell capability. This is DDMi agent!')


        Framework.setStepExecutionStatus(WorkflowStepStatus.SUCCESS)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:32,代码来源:DDMiConnect.py


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