def DiscoveryMain(Framework): credentialsId = Framework.getDestinationAttribute('credentialsId') OSHVResult = ObjectStateHolderVector() matchers = SiebelAgent.SIEBEL_DEFAULT_ENTERPRISE_MATCHERS ip = Framework.getDestinationAttribute('ip_address') port = Framework.getDestinationAttribute('port') if port == 'NA': port = None try: client = None try: client = siebel_common.createClient(Framework, ip, matchers, credentialsId, port) username = client.getUserName() enterprise = client.getEnterprise() siteOSH = ObjectStateHolder('siebel_site') siteOSH.setAttribute('data_name', enterprise) siteOSH.setAttribute('gateway_address', ip) modeling.setAppSystemVendor(siteOSH) start_srvrmgr_discovery(client, ip, username, enterprise, siteOSH, Framework, OSHVResult) finally: if client is not None: client.close() except Exception, ex: strException = str(ex.getMessage()) errormessages.resolveAndReport(strException, PROTOCOL_NAME, Framework) logger.debugException('')
def _connectToGateway(ip, port, credentialsId, matchers, Framework, errors, warnings): client = None try: client = siebel_common.createClient(Framework, ip, matchers, credentialsId, port) return client except JException, ex: strException = ex.getMessage() errormessages.resolveAndAddToCollections(strException, PROTOCOL_NAME, warnings, errors) logger.debugException('') if client: client.close()