Exemplo n.º 1
0
def DiscoveryMain(framework):
    vector = ObjectStateHolderVector()
    protocol = framework.getDestinationAttribute('Protocol')
    try:
        client = framework.createClient()
        shell = None
        try:
            shell = shellutils.ShellUtils(client)
            dnsDiscoverer = dns_discoverer.createDiscovererByShell(shell)
            params = _obtainParams(framework)
            zoneNameList, includeOutscopeIPs, reportBrokenAliases = params
            zoneTopologies = dns_discoverer.discoverDnsZoneTopologies(
                dnsDiscoverer, zoneNameList, protocol)
            vector.addAll(
                dns_discoverer.reportTopologies(zoneTopologies,
                                                includeOutscopeIPs,
                                                reportBrokenAliases))
        finally:
            try:
                shell and shell.closeClient()
            except:
                logger.debugException('')
                logger.error('Unable to close shell')
    except JException, ex:
        exInfo = ex.getMessage()
        errormessages.resolveAndReport(exInfo, protocol, framework)
Exemplo n.º 2
0
def DiscoveryMain(framework):
    vector = ObjectStateHolderVector()
    protocol = 'local_shell'
    try:
        zoneNameList, includeOutscopeIPs, ip, reportBrokenAliases = _obtainParams(
            framework)
        if not zoneNameList:
            logger.reportError('List of zones for transfer is not specified')
            return
        client = framework.createClient(
            ClientsConsts.LOCAL_SHELL_PROTOCOL_NAME)
        shell = None
        try:
            shell = shellutils.ShellUtils(client)
            #pass name server IP to the discoverer
            dnsDiscoverer = dns_discoverer.createDiscovererByShell(shell, ip)
            zoneTopologies = dns_discoverer.discoverDnsZoneTopologies(
                dnsDiscoverer, zoneNameList, protocol)
            vector.addAll(
                dns_discoverer.reportTopologies(zoneTopologies,
                                                includeOutscopeIPs,
                                                reportBrokenAliases))
        finally:
            try:
                shell and shell.closeClient()
            except:
                logger.debugException('')
                logger.error('Unable to close shell')
    except JException, ex:
        exInfo = ex.getMessage()
        errormessages.resolveAndReport(exInfo, protocol, framework)
Exemplo n.º 3
0
def DiscoveryMain(framework):
    vector = ObjectStateHolderVector()
    protocol = 'local_shell'
    try:
        zoneNameList, includeOutscopeIPs, ip, reportBrokenAliases = _obtainParams(framework)
        if not zoneNameList:
            logger.reportError('List of zones for transfer is not specified')
            return
        client = framework.createClient(ClientsConsts.LOCAL_SHELL_PROTOCOL_NAME)
        shell = None
        try:
            shell = shellutils.ShellUtils(client)
            #pass name server IP to the discoverer
            dnsDiscoverer = dns_discoverer.createDiscovererByShell(shell, ip)
            zoneTopologies = dns_discoverer.discoverDnsZoneTopologies(dnsDiscoverer, zoneNameList, protocol)
            vector.addAll(dns_discoverer.reportTopologies(zoneTopologies, includeOutscopeIPs, reportBrokenAliases))
        finally:
            try:
                shell and shell.closeClient()
            except:
                logger.debugException('')
                logger.error('Unable to close shell')
    except JException, ex:
        exInfo = ex.getMessage()
        errormessages.resolveAndReport(exInfo, protocol, framework)
def DiscoveryMain(framework):
    vector = ObjectStateHolderVector()
    protocol = framework.getDestinationAttribute("Protocol")
    try:
        client = framework.createClient()
        shell = None
        try:
            shell = shellutils.ShellUtils(client)
            dnsDiscoverer = dns_discoverer.createDiscovererByShell(shell)
            params = _obtainParams(framework)
            zoneNameList, includeOutscopeIPs, reportBrokenAliases = params
            zoneTopologies = dns_discoverer.discoverDnsZoneTopologies(dnsDiscoverer, zoneNameList, protocol)
            vector.addAll(dns_discoverer.reportTopologies(zoneTopologies, includeOutscopeIPs, reportBrokenAliases))
        finally:
            try:
                shell and shell.closeClient()
            except:
                logger.debugException("")
                logger.error("Unable to close shell")
    except JException, ex:
        exInfo = ex.getMessage()
        errormessages.resolveAndReport(exInfo, protocol, framework)